From: Martijn Dekker <martijn@inlv.org>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: 'set -e' with '!' POSIX issue
Date: Wed, 5 Oct 2016 12:18:26 +0200 [thread overview]
Message-ID: <4e660f18-3850-d589-8a17-e75d2c419fbe@inlv.org> (raw)
In-Reply-To: <20161004093005.7dbc6696@pwslap01u.europe.root.pri>
Op 04-10-16 om 10:30 schreef Peter Stephenson:
> On Tue, 4 Oct 2016 09:45:38 +0200
> Vincent Lefevre <vincent@vinc17.net> wrote:
>> I thought that this was not supposed to change:
>>
>> http://www.zsh.org/mla/workers/2009/msg00572.html
>> http://www.zsh.org/mla/workers/2009/msg00574.html
>>
>> I haven't checked the current status for the other two cases.
>
> The point I made there was I was waiting for things to clear up. That
> was 7 years ago. I'm not going to wait any longer for things to clear
> up...
FYI, your patch fixes the simple case ('! true'), but not the two more
complex cases mentioned back then:
On Fri, Mar 13, 2009 at 03:51:34PM +0100, Vincent Lefevre wrote:
> According to the new "set -e" proposal
>
> http://www.opengroup.org/austin/mailarchives/ag/msg18258.html
>
> zsh -c 'set -e; ! if true; then false; fi; echo $?'
>
> should output 0, i.e. "false" should not make the shell exit, because
> it is under a "!" context (even though "!" doesn't apply on the "false"
> command directly).
>
> Note that every other shell (bash, ksh93, pdksh, dash, posh) output 0.
On Tue, Mar 17, 2009 at 12:46:20PM +0100, Vincent Lefevre wrote:
> POSIX shells (bash, dash, ksh93, pdksh, posh) return with no output
> and an exit status equal to 1 on:
>
> sh -c 'set -e; foo() { false && false; }; foo; echo $?'
>
> but zsh doesn't, even with "emulate sh":
>
> $ zsh -fc 'emulate sh; set -e; foo() { false && false; }; foo; echo $?'
> 1
>
> zsh should match the existing practice (perhaps even without
> "emulate sh", unless this can break too many zsh scripts).
Thanks,
- M.
next prev parent reply other threads:[~2016-10-05 10:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-02 10:01 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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4e660f18-3850-d589-8a17-e75d2c419fbe@inlv.org \
--to=martijn@inlv.org \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).