zsh-workers
 help / color / mirror / code / Atom feed
* 'set -e' with '!' POSIX issue
@ 2016-10-02 10:01 Martijn Dekker
  2016-10-02 17:55 ` Peter Stephenson
  0 siblings, 1 reply; 9+ messages in thread
From: Martijn Dekker @ 2016-10-02 10:01 UTC (permalink / raw)
  To: Zsh hackers list

'set -e' ('set -o errexit') is not POSIX compliant on zsh because it
doesn't ignore a command beginning with "!".

The script:

    set -e
    ! true
    echo good

should output "good", and does, on every shell except zsh.

Ref.:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_25
| 2. The -e setting shall be ignored when executing the compound list
| following the while, until, if, or elif reserved word, a pipeline
| beginning with the ! reserved word, or any command of an AND-OR list
| other than the last.

(Note that in POSIX terms the definition of "pipeline" includes a simple
command.)

Thanks,

- Martijn


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-10-06 11:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-02 10:01 'set -e' with '!' POSIX issue Martijn Dekker
2016-10-02 17:55 ` Peter Stephenson
2016-10-04  7:45   ` Vincent Lefevre
2016-10-04  8:30     ` Peter Stephenson
2016-10-05 10:18       ` Martijn Dekker
2016-10-05 11:37         ` Peter Stephenson
2016-10-05 13:47         ` Peter Stephenson
2016-10-06  8:36           ` Peter Stephenson
2016-10-06 11:22           ` Martijn Dekker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).