From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11342 invoked by alias); 2 Oct 2016 10:01:35 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39536 Received: (qmail 12347 invoked from network); 2 Oct 2016 10:01:35 -0000 X-Qmail-Scanner-Diagnostics: from kahlil.inlv.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(37.59.109.123):SA:0(-3.1/5.0):. Processed in 0.448434 secs); 02 Oct 2016 10:01:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: martijn@inlv.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at inlv.org does not designate permitted sender hosts) To: Zsh hackers list From: Martijn Dekker Subject: 'set -e' with '!' POSIX issue Message-ID: <70cf25f2-f156-51c4-60b6-00def8769328@inlv.org> Date: Sun, 2 Oct 2016 11:01:18 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit '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