From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: PRINT_EXIT_VALUE problems
Date: Wed, 28 Dec 2011 11:28:35 -0800 [thread overview]
Message-ID: <111228112835.ZM29173@torch.brasslantern.com> (raw)
In-Reply-To: <111226234028.ZM23820@torch.brasslantern.com>
Sorry for forgetting to redirect my own last reply to zsh-workers even
though I meant to. I'm keeping this one on -users on purpose, because
it's no longer about code details.
On Dec 24, 12:13pm, Vincent Lefevre wrote:
}
} xvii% setopt PRINT_EXIT_VALUE
} xvii% false || true
} zsh: exit 1
}
} 1. I don't think the value should be printed in the case of a program
} before ||, because the goal of || is to ignore or handle the error.
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. Is that really desirable?
What about
torch% { (return 3); (return 2); return 1 } || true
Which exit values should be printed there?
next prev parent reply other threads:[~2011-12-28 19:29 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 [this message]
2011-12-29 2:36 ` Vincent Lefevre
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=111228112835.ZM29173@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--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).