On Mon, Nov 26, 2007 at 01:32:32PM +0100, Vincent Lefevre wrote:
> When some builtins such as "set" or "shift" fails, dash doesn't execute
> the remaining commands of the command line:
> 
> $ set -o pipefail; echo OK
> set: 1: Illegal option -o pipefail
> $ shift; echo OK
> shift: 2: can't shift that many
> $ cd does_not_exist; echo OK
> cd: 3: can't cd to does_not_exist
> OK
> $
> 
> One can see that "set" and "shift" are affected, but not "cd".

Yes.  set and shift are so called 'special builtins', and show different
behavior on errors, as documented here:

 
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_14
 http://www.opengroup.org/onlinepubs/009695399/idx/sbi.html
 
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_08_01

So dash is right, it should exit an interactive shell on, e.g., the 'set
-o pipefail' error.

Regards, Gerrit.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to