From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-users@zsh.org
Subject: Re: PRINT_EXIT_VALUE problems
Date: Thu, 29 Dec 2011 03:36:38 +0100 [thread overview]
Message-ID: <20111229023638.GZ5329@xvii.vinc17.org> (raw)
In-Reply-To: <111228112835.ZM29173@torch.brasslantern.com>
On 2011-12-28 11:28:35 -0800, Bart Schaefer wrote:
> I've been thinking about this a bit more.
>
> Consider the case of a pipeline -- here's a silly example:
>
> torch% return 3 | return 2 | return 1 | true
> zsh: exit 3 return 3 |
> zsh: exit 2 return 2 |
> zsh: exit 1 return 1
> torch%
>
> Now consider:
>
> torch% return 3 | return 2 | return 1 || true
>
> If we followed your suggestion above, we should suppress printing the
> exit values of every stage of the pipeline.
I don't think so, since the exit values of "return 3" and "return 2"
don't affect the exit value of the pipeline. The "|| ..." should
mean that one isn't interested in the exit value of the pipeline
and what caused this exit value (i.e. "return 1").
> Is that really desirable?
>
> What about
>
> torch% { (return 3); (return 2); return 1 } || true
>
> Which exit values should be printed there?
(return 3) and (return 2) do not affect the tested value for ||, thus
there exit values should be printed. The tested value for || is the
exit value of "return 1", thus this one should not be printed.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)
next prev parent reply other threads:[~2011-12-29 2:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-24 11:13 Vincent Lefevre
2011-12-27 7:40 ` Bart Schaefer
2011-12-27 17:30 ` Bart Schaefer
2011-12-28 19:28 ` Bart Schaefer
2011-12-29 2:36 ` Vincent Lefevre [this message]
2011-12-30 20:11 ` autoload syntax Ray Andrews
2011-12-30 21:07 ` Bart Schaefer
2011-12-31 3:32 ` Mark van Dijk
2012-01-04 17:35 ` Ray Andrews
2012-01-05 20:13 ` Peter Stephenson
2012-01-05 20:32 ` Ray Andrews
2012-01-05 21:01 ` Peter Stephenson
2012-01-05 21:06 ` Mikael Magnusson
[not found] ` <4F06163D.9040800@eastlink.ca>
2012-01-05 21:33 ` Mikael Magnusson
2011-12-28 16:26 ` PRINT_EXIT_VALUE problems Nathan Dorfman
2011-12-28 18:42 ` Vincent Lefevre
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=20111229023638.GZ5329@xvii.vinc17.org \
--to=vincent@vinc17.net \
--cc=zsh-users@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).