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

Reply via email to