Re: Regex matching oddity (bug, or 'unexpected feature' or...?)

2009-05-28 Thread pk
On Thursday 28 May 2009 22:38, pk wrote: > Yes, if the second argument is quoted, it's treated as a literal string. > If you want the regex behavior, you should not quote it: > > if [[ "$Var" =~ +([:digit:]) ]]; then . > > That behavior changed at some point during 3.2 (too lazy to check now).

Re: Regex matching oddity (bug, or 'unexpected feature' or...?)

2009-05-28 Thread pk
On Thursday 28 May 2009 21:58, Linda Walsh wrote: > But when I used regex pattern matching in the if, the spaces around the > operator > caused a failure in matching. I.e.: > if [[ "$Var"=~"+([:digit:])" ]] ; then ... > worked. "worked" in the sense that [[ .. ]] evaluated a single argument: the

Re: Regex matching oddity (bug, or 'unexpected feature' or...?)

2009-05-28 Thread Greg Wooledge
On Thu, May 28, 2009 at 12:58:10PM -0700, Linda Walsh wrote: > operator caused a failure in matching. I.e.: > if [[ "$Var"=~"+([:digit:])" ]] ; then ... > worked. No, this is incorrect. You need spaces around the =~ so that it's parsed as three separate things, rather than one thing. Your

Re: bash does not wait for called script to finish

2009-05-28 Thread Seved Torstendahl
Chet Ramey skrev: Seved Torstendahl wrote: Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDO

Regex matching oddity (bug, or 'unexpected feature' or...?)

2009-05-28 Thread Linda Walsh
Instead of checking if "$Var" was equal or not equal, I wanted to use pattern matching. Normally, for = or !=, I'd write: if [[ "$Var" = "4" ]]; then ... But when I used regex pattern matching in the if, the spaces around the operator caused a failure in matching. I.e.: if [[

Re: read -e bug

2009-05-28 Thread Chet Ramey
Chris F.A. Johnson wrote: > On Thu, 28 May 2009, Chet Ramey wrote: > >>> This is nothing new; it happens in all versions of bash: >>> >>> printf "Enter something: " >>> read -e whatever >>> >>> Press a key, then cursor left (or ^A); the cursor moves to the >>> beginning of the line, over "E" inste

Re: read -e bug

2009-05-28 Thread Chris F.A. Johnson
On Thu, 28 May 2009, Pierre Gaston wrote: > On Thu, May 28, 2009 at 3:52 PM, Chris F.A. Johnson > wrote: > > On Thu, 28 May 2009, Chet Ramey wrote: > > > >> > > >> > This is nothing new; it happens in all versions of bash: > >> > > >> > printf "Enter something: " > >> > read -e whatever > >> > >

Re: Documentation discrepancy

2009-05-28 Thread Chet Ramey
Mitar wrote: > Hi! > > I have found a discrepancy between documentation (man page) and > behavior of Bash under -e switch. In documentation it is written: > > The shell does not exit if the command that fails is part of the > command list immediately following a while or until keyword, part of >

Re: read -e bug

2009-05-28 Thread Pierre Gaston
On Thu, May 28, 2009 at 3:52 PM, Chris F.A. Johnson wrote: > On Thu, 28 May 2009, Chet Ramey wrote: > >> > >> > This is nothing new; it happens in all versions of bash: >> > >> > printf "Enter something: " >> > read -e whatever >> > >> > Press a key, then cursor left (or ^A); the cursor moves to t

Re: read -e bug

2009-05-28 Thread Chris F.A. Johnson
On Thu, 28 May 2009, Chet Ramey wrote: > > > > This is nothing new; it happens in all versions of bash: > > > > printf "Enter something: " > > read -e whatever > > > > Press a key, then cursor left (or ^A); the cursor moves to the > > beginning of the line, over "E" instead of over the characte

Re: read -e bug

2009-05-28 Thread Chet Ramey
> > This is nothing new; it happens in all versions of bash: > > printf "Enter something: " > read -e whatever > > Press a key, then cursor left (or ^A); the cursor moves to the > beginning of the line, over "E" instead of over the character just > entered. This isn't a bug; that's where readli

Bash loadable plugins ... minimal header file?

2009-05-28 Thread Dr. Werner Fink
Hi, AFAICS from examples/loadables/ a lot of headers are readed by the compiler which requires - beside the bash and the readline library - an further package (rpm/deb) bash-devel for including all those headers ... beside this the Makefiles do not install any of them. Therefore my question: how