bug-bash@gnu.org

2012-10-14 Thread Linda Walsh
Steven W. Orr wrote: On 10/12/12 06:55, quoth Sergey Fadeev: Why doesn't it exit the shell? $ set -e $ echo $(false) Shouldn't the error code of $(false) command substitution be checked by set -e before passing stdout to the echo builtin? Isn't it the most logical behavior that most p

Re: tab completion with variable expansion broken

2012-10-14 Thread Chet Ramey
On 10/14/12 8:52 AM, William F Hammond wrote: > > Configuration Information [Automatically generated, do not change]: > Machine: i686 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' > -

tab completion with variable expansion broken

2012-10-14 Thread William F Hammond
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/src/gnu/share/locale

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-14 Thread Chet Ramey
On 10/14/12 7:26 AM, Dan Douglas wrote: > On Sunday, October 14, 2012 11:46:17 AM Wladimir Sidorenko wrote: >> To my mind '!' looks pretty much like a unary operator and '|' like a binary > one. > > This isn't as confusing as the associativity and nesting problem. Think of `!' and `time' as rese

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-14 Thread Chet Ramey
On 10/14/12 5:19 AM, Wladimir Sidorenko wrote: > Provided '-o pipefail' is not specified. Sure, but Posix standardized `!' and not the `pipefail' option. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-14 Thread Chet Ramey
On 10/14/12 4:46 AM, Wladimir Sidorenko wrote: >> What do you think should happen in the following case? >> ! exit 1 | exit 2 | exit 3 > > To my mind the '!' operator should have had a higher precedence during > parsing command line arguments than the pipe and applied only to the > command it was

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-14 Thread Dan Douglas
On Sunday, October 14, 2012 11:46:17 AM Wladimir Sidorenko wrote: > To my mind '!' looks pretty much like a unary operator and '|' like a binary one. This isn't as confusing as the associativity and nesting problem. $ ( ! time ! : | :; echo $? "( ${PIPESTATUS[@]} )" ) 2>/dev/null 0 ( 0 0 ) $ (

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-14 Thread Wladimir Sidorenko
Provided '-o pipefail' is not specified. 2012/10/14 Andreas Schwab : > Wladimir Sidorenko writes: > >> To my mind the '!' operator should have had a higher precedence during >> parsing command line arguments than the pipe and applied only to the >> command it was immediately preceding. So that in

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-14 Thread Andreas Schwab
Wladimir Sidorenko writes: > To my mind the '!' operator should have had a higher precedence during > parsing command line arguments than the pipe and applied only to the > command it was immediately preceding. So that in > > ! command1 | command2 | command3 > > it would only negate command1. Wh

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-14 Thread Wladimir Sidorenko
> What do you think should happen in the following case? > ! exit 1 | exit 2 | exit 3 To my mind the '!' operator should have had a higher precedence during parsing command line arguments than the pipe and applied only to the command it was immediately preceding. So that in ! command1 | command2