Re: Strange change between bash-3.2 and bash-4.0

2009-02-10 Thread Chet Ramey
> -e > When this option is on, if a simple command fails for any of the reasons > listed in Consequences of Shell Errors or returns an exit status value >0, and > is not part of the compound list following a while, until, or if keyword, and > is not a part of an AND or OR list, and is not a pip

Re: Strange change between bash-3.2 and bash-4.0

2009-02-10 Thread Roman Rakus
Chet Ramey wrote: Roman Rakus wrote: Hi there is simple script: #!/bin/sh echo foo|cat /nosuchfile echo "here: $?" executed by sh -e In bash-3.2 we got: cat: /nosuchfile: No such file or directory but in bash-4.0: cat: /nosuchfile: No such file or directory here: 1 The bash-4.0 behav

Re: Strange change between bash-3.2 and bash-4.0

2009-02-10 Thread Roman Rakus
Chet Ramey wrote: Roman Rakus wrote: If this stays as it is, bash will never exit immediately if a command (in this case pipeline) exits with a non-zero status. That's clearly not true. Bash will not exit if a pipeline fails, but will do so if a simple command fails. Isn't it th

Re: Strange change between bash-3.2 and bash-4.0

2009-02-10 Thread Chet Ramey
Roman Rakus wrote: > If this stays as it is, bash will never exit immediately if a command > (in this case pipeline) exits with a non-zero status. That's clearly not true. Bash will not exit if a pipeline fails, but will do so if a simple command fails. -- ``The lyf so short, the craft so long

Re: Strange change between bash-3.2 and bash-4.0

2009-02-10 Thread Chet Ramey
Roman Rakus wrote: > Hi > there is simple script: > #!/bin/sh > echo foo|cat /nosuchfile > echo "here: $?" > > executed by sh -e > In bash-3.2 we got: > cat: /nosuchfile: No such file or directory > > but in bash-4.0: > cat: /nosuchfile: No such file or directory > here: 1 The bash-4.0 behavior

Re: Strange change between bash-3.2 and bash-4.0

2009-02-10 Thread Roman Rakus
Roman Rakus wrote: Hi there is simple script: #!/bin/sh echo foo|cat /nosuchfile echo "here: $?" executed by sh -e In bash-3.2 we got: cat: /nosuchfile: No such file or directory but in bash-4.0: cat: /nosuchfile: No such file or directory here: 1 From execute_cmd.c: /* 10/6/2008 -- added te

Strange change between bash-3.2 and bash-4.0

2009-02-10 Thread Roman Rakus
Hi there is simple script: #!/bin/sh echo foo|cat /nosuchfile echo "here: $?" executed by sh -e In bash-3.2 we got: cat: /nosuchfile: No such file or directory but in bash-4.0: cat: /nosuchfile: No such file or directory here: 1 From execute_cmd.c: /* 10/6/2008 -- added test for pipe_in and p