{varname} for redirection does not work with arrays

2011-11-04 Thread unknown
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-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/home/lester/bas

Bug in bash regex: doesn't recognise the line start caret

2011-11-04 Thread Graham North
Hi, There seems to be a bug in bash regex. It doesn't recognise the line start caret: --Commands: ONE="/fred" TWO="fred/" REGEX='^/' echo "$ONE $TWO $REGEX" [[ "$ONE" =~ "$REGEX" ]] && echo yes || echo no [[ "$TWO" =~ "$REGEX" ]] && echo yes || echo no --Result: /fred fred/ ^/ no no Not sure

[[ str =~ "^pattern" ]] no longer works

2011-11-04 Thread flong
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-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/local

Re: Bug in bash regex: doesn't recognise the line start caret

2011-11-04 Thread DJ Mills
On Fri, Nov 4, 2011 at 4:31 AM, Graham North wrote: > Hi, > > There seems to be a bug in bash regex. > > It doesn't recognise the line start caret: > > --Commands: > ONE="/fred" > TWO="fred/" > REGEX='^/' > echo "$ONE $TWO $REGEX" > [[ "$ONE" =~ "$REGEX" ]] && echo yes || echo no > [[ "$TWO" =~ "$

Re: [[ str =~ "^pattern" ]] no longer works

2011-11-04 Thread Roman Rakus
On 11/04/2011 09:09 AM, flong@dell1.localdomain 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-unknown-linux-gn

Re: [[ str =~ "^pattern" ]] no longer works

2011-11-04 Thread Greg Wooledge
On Fri, Nov 04, 2011 at 05:30:52PM +0100, Roman Rakus wrote: > On 11/04/2011 09:09 AM, flong@dell1.localdomain wrote: > > [[ "-h" =~ '^-h' ]] ; echo $? > > Should return 0, but instead returns 1. > > > It was bug in previous versions of bash in fedora and RHEL. > This behavior is correct no

Re: {varname} for redirection does not work with arrays

2011-11-04 Thread Dennis Williamson
You're missing a dollar sign.

bash-completion between do and done

2011-11-04 Thread Peng Yu
Hi, Current, bash doesn't do command completion between do and done (for loop). I'm wondering if this feature can be added. -- Regards, Peng

Re: bash-completion between do and done

2011-11-04 Thread Bob Proulx
Peng Yu wrote: > Current, bash doesn't do command completion between do and done (for loop). > I'm wondering if this feature can be added. Of course bash does do command completion between do and done. Can you give an exact example test case? On what version of bash? Bob