Re: Problem with open and rm

2011-03-16 Thread Micah Cowan
(03/16/2011 03:54 AM), Barrie Stott wrote: > The script that follows is a cut down version of one that came from elsewhere. > > #!/bin/bash > > cp /tmp/x.html /tmp/$$.html > ls /tmp/$$.html > [ "$DISPLAY" ] && open /tmp/$$.html > ls /tmp/$$.html > rm -f /tmp/$$.html > > I'm on an Imac with OS X

Re: Infinite loop in globbing

2011-03-14 Thread Micah Cowan
On 03/14/2011 10:06 AM, Chet Ramey wrote: >> On 03/14/2011 07:55 AM, Chet Ramey wrote: >>> The question is how to best handle it: punt immediately, or just treat it >>> as a single-byte character and move on. >> >> I vote single-byte character; after all, it's possible for a filename to >> contain

Re: Infinite loop in globbing

2011-03-14 Thread Micah Cowan
On 03/14/2011 07:55 AM, Chet Ramey wrote: > The question is how to best handle it: punt immediately, or just treat it > as a single-byte character and move on. I vote single-byte character; after all, it's possible for a filename to contain that character, regardless of what your locale may be. -

Re: IMPLEMENTATION [Re: Hightlighting in bash]

2011-03-10 Thread Micah Cowan
(03/10/2011 02:03 PM), Philip Prindeville wrote: > A lot of programs don't behave properly (or perhaps, "don't behave the > same") when they detect that stdout isn't a terminal. But I think > someone else mentioned this already. Yeah. You could always run the program under another program that fo

Re: Hightlighting in bash

2011-03-10 Thread Micah Cowan
(03/10/2011 12:55 PM), Chet Ramey wrote: > On 3/10/11 3:49 PM, Micah Cowan wrote: >> (03/10/2011 12:07 PM), Chet Ramey wrote: >>> This doesn't seem like it has to be done in bash. A small program that >>> allocated and opened a pty, ran bash in the pty (or an arb

Re: IMPLEMENTATION [Re: Hightlighting in bash]

2011-03-10 Thread Micah Cowan
(03/10/2011 12:28 PM), Micah Cowan wrote: > (03/10/2011 11:53 AM), Micah Cowan wrote: >> (03/10/2011 11:42 AM), Philip Prindeville wrote: >>> My request is simple. Using termcap/ncurses info (which you need anyway >>> for the readline stuff), it would be nice to

Re: Hightlighting in bash

2011-03-10 Thread Micah Cowan
(03/10/2011 12:07 PM), Chet Ramey wrote: > On 3/10/11 2:42 PM, Philip Prindeville wrote: > >> My request is simple. Using termcap/ncurses info (which you need anyway >> for the readline stuff), it would be nice to have the option of running >> commands in a pseudo-tty and then bracketing the outp

Re: Hightlighting in bash

2011-03-10 Thread Micah Cowan
(03/10/2011 12:27 PM), Philip Prindeville wrote: > On 3/10/11 11:53 AM, Micah Cowan wrote: >> (03/10/2011 11:42 AM), Philip Prindeville wrote: >>> My request is simple. Using termcap/ncurses info (which you need anyway >>> for the readline stuff), it would be nice to

IMPLEMENTATION [Re: Hightlighting in bash]

2011-03-10 Thread Micah Cowan
(03/10/2011 11:53 AM), Micah Cowan wrote: > (03/10/2011 11:42 AM), Philip Prindeville wrote: >> My request is simple. Using termcap/ncurses info (which you need anyway >> for the readline stuff), it would be nice to have the option of running >> commands in a pseudo-tty an

Re: Hightlighting in bash

2011-03-10 Thread Micah Cowan
(03/10/2011 11:42 AM), Philip Prindeville wrote: > My request is simple. Using termcap/ncurses info (which you need anyway > for the readline stuff), it would be nice to have the option of running > commands in a pseudo-tty and then bracketing the output from STDERR with > This doesn't strik

Re: [bash-bug] no local bash_history created or written to if existing (~/.bash_history

2011-03-08 Thread Micah Cowan
(03/08/2011 09:19 AM), Roman Rakus wrote: > On 03/08/2011 06:02 PM, Chet Ramey wrote: >> I really wish there was a better solution to the close button problem >> than SIGHUP. > +1, or learn people to exit from shell. Yeah, but what of when your ssh connection goes down (and you're not using screen

Re: How to safely pipe output to tee?

2011-03-07 Thread Micah Cowan
(03/07/2011 12:22 PM), Steven W. Orr wrote: > Sorry, but I'm not sure I see why this helps. > > I think it says (I assume you meant a space between the 100 and the > greater than, otherwise you're just trying to close channel 100): > > foo='sleep 100 >&- 2>&- &' Yeah. That's how I typed it. Your

Re: How to safely pipe output to tee?

2011-03-07 Thread Micah Cowan
(03/07/2011 10:31 AM), Steven W. Orr wrote: > I want to compute a command string which will end up in foo. > > Then I want to run that command and cause stdout and stderr to be piped > to tee for safe keeping while it also goes to the screen. > > After the command finishes, I need tee to exit. >

Re: How to match pattern in bash?

2011-02-23 Thread Micah Cowan
On 02/23/2011 05:25 AM, Greg Wooledge wrote: > On Tue, Feb 22, 2011 at 08:03:39PM -0800, Micah Cowan wrote: >> Bash's special builtin [[ ]] syntax also provides both wildcards, and >> (much more powerful) extended regexes (roughly similar to Perl regexes; >> they're

Re: How to match pattern in bash?

2011-02-22 Thread Micah Cowan
On 02/22/2011 07:24 PM, Peng Yu wrote: > Suppose that I have a variable $x, I want to test if the content of $x > match the pattern 'abc*'. If yes, then do something. (The operator == > doesn't match patterns, if I understand it correctly.) > > Is there such a build-in feature in bash? Or I have t

Patch: Corrupt display for history search in vi-mode, 256-color prompt

2011-02-22 Thread Micah Cowan
This bug affects both readline and bash (however, it is expected that this bug is far more likely to affect bash than other typical readline-using applications). It was experienced on bash 4.1-2ubuntu4 (on Ubuntu 10.10, "Maverick Meercat"), but I checked the sources for readline 6.2 and bash 4.2, a

Re: Screen under eterm, send_pwd_to_eterm

2008-07-11 Thread Micah Cowan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chet Ramey wrote: > Micah Cowan wrote: >> (Please Cc me in replies, as I am not subscribed here.) >> >> A user reported some annoying/puzzling behavior when running GNU Screen >> under bash under eterm: Every prompt would

Screen under eterm, send_pwd_to_eterm

2008-07-08 Thread Micah Cowan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 (Please Cc me in replies, as I am not subscribed here.) A user reported some annoying/puzzling behavior when running GNU Screen under bash under eterm: Every prompt would be preceded by the current working directory path, preceded by an extra slash. F