From: ramos@ih4ess.ih.lucent.com
To: zsh-workers@math.gatech.edu
Subject: this && that || the other && this too
Date: Tue, 7 Oct 1997 19:47:51 -0500 [thread overview]
Message-ID: <199710080047.TAA10231@ihnns581.ih.lucent.com> (raw)
hello zsh developers! Congrats on a very nice job.
I found a "problem" that perhaps some interested volunteer
would care to look into.
Consider it a special exercise for those who thought zsh
already implements all shell features that can possibly be
implemented :-)
Apparently there is no way to construct an expression
using "&&" and "||" of the form:
cmd1 XX cmd2 XX cmd3
such that both cmd2 and cmd3 execute when cmd1 succeeds,
and neither cmd2 nor cmd3 execute when cmd1 fails.
examples that do not work:
% echo yo && true || echo A || echo B
yo
% echo yo && false || echo A || echo B
yo
A
% echo yo && true || echo A && echo B
yo
B
% echo yo && false || echo A && echo B
yo
A
B
"It would be nice" to be able to do this without using ()'s, or
if/then/fi, or some other contorted workaround.
Thanks,
Alex Ramos
atramos@lucent.com
% echo $ZSH_VERSION
3.0.5
% uname -a
SunOS ihnns581 5.5.1 Generic_103640-09 sun4u sparc SUNW,Ultra-1
next reply other threads:[~1997-10-08 1:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-10-08 0:47 ramos [this message]
1997-10-08 3:17 ` Bart Schaefer
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=199710080047.TAA10231@ihnns581.ih.lucent.com \
--to=ramos@ih4ess.ih.lucent.com \
--cc=zsh-workers@math.gatech.edu \
/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).