nounset option and arrays

2009-02-05 Thread Poor Yorick
In the following example, I was expecting var2 not to be seen as an unbound variable after it was declared. Wouldn't it be more consistent with the treatment of var1 not to issue the unbound variable error in this case? What is the rationale behind the current behavior? bash-3.2$ shopt -s

Re: Migrating from tcsh to bash (issues)

2009-02-05 Thread Matthew Woehlke
Simos wrote: Regarding printexitvalue, I use trap '__exit_value_bashrc=$?; if [ $__exit_value_bashrc -ne 0 ]; then echo "Exit $__exit_value_bashrc"; fi' ERR so that an exit value is printed when it is other than 0. That shouldn't be necessary. An exit of 0 is not considered an error, and so

nounset option and arrays

2009-02-05 Thread Poor Yorick
In the following example, I was expecting var2 not to be seen as an unbound variable after it was declared. Wouldn't it be more consistent with the treatment of var1 not to issue the unbound variable error in this case? What is the rationale behind the current behavior? bash-3.2$ shopt -

Re: Fwd: nounset option and arrays

2009-02-05 Thread Chet Ramey
> In the following example, I was expecting var2 not to be seen as an unbound > variable after it was declared. Wouldn't it be more consistent with the > treatment of var1 not to issue the unbound variable error in this case? What > is the rationale behind the current behavior? > > bash-

Re: Migrating from tcsh to bash (issues)

2009-02-05 Thread Simos
On Thu, Feb 5, 2009 at 7:12 PM, Matthew Woehlke wrote: > Simos wrote: >> >> Regarding printexitvalue, I use >> >> trap '__exit_value_bashrc=$?; if [ $__exit_value_bashrc -ne 0 ]; then >> echo "Exit $__exit_value_bashrc"; fi' ERR >> >> so that an exit value is printed when it is other than 0. > > T

infinitive recursion causes segfault

2009-02-05 Thread yozh
Configuration Information [Automatically generated, do not change]: Machine: i486 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba

Re: infinitive recursion causes segfault

2009-02-05 Thread Chet Ramey
y...@mx1.ru wrote: > Bash Version: 3.1 > Patch Level: 17 > Release Status: release > > Description: > Create a function that calls itself. Call it. You'll get segfault. > Expecting message on terminal. That's not a good expectation. If you want to shoot yourself in the foot, bash will no