extglobs in case constructs

2009-10-01 Thread Martin von Gagern
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: i686-pc-linux-gnu-gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc'

Re: extglobs in case constructs

2009-10-01 Thread Martin von Gagern
Greg Wooledge wrote: You're using extglobs inside a function, and extglob was enabled at the time the function was delcared. The parser parsed them at that time, decided that they are extended globs, and therefore that's what they are. Then why don't they work as extended globs if the

Re: preventing pipe reader from existing on writer exiting

2009-10-01 Thread Brian J. Murrell
On Wed, 2009-09-30 at 23:13 +0200, Andreas Schwab wrote: Just make sure the write side of the pipe is not closed prematurely. Hrm. Yes, of course. John's solution of having a null writer keeping it open is one way -- which I might just use. $ (n=0; while [ $n -lt 10 ]; do cat /dev/zero;

Re: preventing pipe reader from existing on writer exiting

2009-10-01 Thread Andreas Schwab
Brian J. Murrell br...@interlinx.bc.ca writes: But this is where (simplified) my example using cat went sideways. :-( In my real world use, the first cat is actually mplayer and doesn't have the option of writing to stdout instead of a named file for this particular use of it. Perhaps you

Re: extglobs in case constructs

2009-10-01 Thread Martin von Gagern
Martin von Gagern wrote: I've found out that extglobs behave differently in different constructs. To avoid syntax errors, the always have to be enabled at parse time. For comparison constructs like ``[[ $v == a@(a|b|c)c ]]'' this is enough. For case constructs

Buffer underflow in help builtin with narrow window

2009-10-01 Thread Chris Hall
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: i686-pc-linux-gnu-gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc'

Re: extglobs in case constructs

2009-10-01 Thread Martin von Gagern
Chet Ramey wrote: In general, if you enable extglob before a function is parsed and leave it on when the function is executed, you should be ok. I'm thinking about this in terms of bash completion functions. Many of them use extended globs, but they should not force a specific permanent extglob

Re: extglobs in case constructs

2009-10-01 Thread Chet Ramey
Martin von Gagern wrote: Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: i686-pc-linux-gnu-gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'