bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -e does not work with subscript


From: Pierre Gaston
Subject: Re: -e does not work with subscript
Date: Tue, 29 Jan 2008 21:24:15 +0200

On Jan 29, 2008 8:09 PM, Stepan Koltsov <yozh@mx1.ru> wrote:
> What is "simple command"?
>
> Is
>
> ===
> ( false ) || false
> ===
>
> simple? Seems like it is not, however
>
> ===
> set -e
>
> ( false ) || false
>
> echo "end"
> ===
>
> Prints nothing and exits with error.

Indeed according to man bash, this is a list It is perhaps possible to
consider that the last false is executed as a simple
command but I think the documentation of set -e could perhaps be made
more clear about what happens when
the last command of a list exits with non 0.

I understand why it is implemented this way, so that any non processed
error exits the shell.

The shells seems to disagree on what (false) should do (ksh and zsh
exit the shell, dash and bash only the subshell.
They also seems to disagree on what ! true should do ( zsh exits, bash
dash and ksh don't)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]