From: dexen deVries <dexen.devries@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] p9p mk rc help
Date: Wed, 20 Nov 2013 12:13:51 +0100 [thread overview]
Message-ID: <CAJUT6o616qwHvKtrRi2Rdx98r1kTAs5ejAk1tLktaoX10HLKrQ@mail.gmail.com> (raw)
Hi list,
apologies for the keyword overload ;-)
I have a plan9port mkfile using Rc (MKSHELL=$PLAN9/bin/rc), a recipe
contains pipeline: FOO_COMMAND | BAR_COMMAND.
What is the correct way of detecting failure exit status of
FOO_COMMAND (a networked operation) and ignoring exit status of
BAR_COMMAND?
the best i came up with is very ugly:
target: prereq
FOO_COMMAND | BAR_COMMAND
st = $status
if (~ $st ?* ^ '|' ^ *) {
echo FOO_COMMAND failed
exit 3 }
seems the | in pattern has to be quoted, otherwise is interpreted as
pipe operator.
regards,
--
dx
next reply other threads:[~2013-11-20 11:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 11:13 dexen deVries [this message]
2013-11-20 14:11 ` erik quanstrom
2013-11-20 14:49 ` arnold
2013-11-20 15:58 ` erik quanstrom
2013-11-20 22:48 ` Tony Lainson
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=CAJUT6o616qwHvKtrRi2Rdx98r1kTAs5ejAk1tLktaoX10HLKrQ@mail.gmail.com \
--to=dexen.devries@gmail.com \
--cc=9fans@9fans.net \
/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.
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).