Hi,
lets consider the following:
$ echo $BASH_VERSION
4.1.2(1)-release
$ cat /etc/system-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)
$ ( set -e; echo foo; false; echo bar; ) # this one is expected
foo
$ ( set -e; echo foo; false; echo bar; ) || true # this one is not expected
f
On Sun, Oct 06, 2013 at 09:37:00PM -0300, Carlos Pita wrote:
> I'm not completely sure whether this is a bug or not but it seems
> not possible to immediately exit a shell when an error happens at 2+
> levels of subshell nesting.
Exiting in a subshell will never cause the parent shell to exit,
r
On Mon, Oct 07, 2013 at 11:01:11AM +0200, Bart?omiej Palmowski wrote:
> $ ( set -e; echo foo; false; echo bar; ) # this one is expected
> foo
> $ ( set -e; echo foo; false; echo bar; ) || true # this one is not expected
> foo
> bar
set -e is useless rubbish that should be avoided.
See http://mywik
On 10/6/13 8:37 PM, Carlos Pita wrote:
> I'm not completely sure whether this is a bug or not but it seems
> not possible to immediately exit a shell when an error happens at 2+
> levels of subshell nesting. Specifically, there is a command at the
> top-level shell waiting for the results of a
On 10/7/13 5:01 AM, Bartłomiej Palmowski wrote:
> Hi,
>
> lets consider the following:
>
> $ echo $BASH_VERSION
> 4.1.2(1)-release
> $ cat /etc/system-release
> Red Hat Enterprise Linux Server release 6.3 (Santiago)
> $ ( set -e; echo foo; false; echo bar; ) # this one is expected
> foo
> $ ( set
> $(xxx) is a word expansion, not a command. Bash will only pay attention to
> the exit status of command substitution in one case (x=$(foo)). This
> command substitution doesn't contribute to any other command's exit status,
> especially `echo', and `set -e' doesn't cause the shell to pay attent
On Mon, Oct 07, 2013 at 11:58:48AM -0300, Carlos Pita wrote:
> > Exiting in a subshell will never cause the parent shell to exit,
> > regardless of depth.
>
> This is not true in general.
> set -e; (exit 1); echo "I don't exist"
In this case, it is the "set -e" which may or may not cause the pare