[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set -e vs. !
From: |
Eric Blake |
Subject: |
Re: set -e vs. ! |
Date: |
Fri, 08 Sep 2006 08:11:02 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Thunderbird/1.5.0.5 Mnenhy/0.7.4.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Dan Jacobson on 9/8/2006 5:42 AM:
> $ cat t.sh
> set -ex
> ! true #should stop here but doesn't!?!
> ! false
> true
> false
> : already quit
> $ bash t.sh
> + true
> + false
> + true
> + false
> $ pdksh t.sh
> + true
Bash is right. This is a bug in pdksh; report it there.
POSIX requires:
- -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
pipeline preceded by the ! reserved word, then the shell shall immediately
exit.
- --
Life is short - so eat dessert first!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFAXn284KuGfSFAYARAujBAKDIgR93kgysy9YsxObpnPMOfD3ymQCcC0D+
tFUbB9z+6/vKCUNHe6X0uj4=
=QlSt
-----END PGP SIGNATURE-----