Re: Declaring a local variable circumvents "-e"

2008-09-24 Thread Bob Proulx
Chet Ramey wrote: > Björn Augustsson wrote: > > fun_bad() { local bah=$( false ); } > > fun_good() { local bah ; bah=$( false ); } > > The `local' command returns success if the variable assignment succeeds, > which it does. The command substitution doesn't affect its exit status. > This is how al

Re: Declaring a local variable circumvents "-e"

2008-09-24 Thread Chet Ramey
Björn Augustsson wrote: > Bash Version: 3.2 > Patch Level: 33 > Release Status: release > > Description: > > The test case below is pretty self-explanatory. > The assignment in fun_bad() doesn't exit the shell, > despite the "set -e". > > This is the version in F

Declaring a local variable circumvents "-e"

2008-09-24 Thread Björn Augustsson
Configuration Information [Automatically generated, do not change]: Machine: i386 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKA