[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to deal with errors in <()?

From: Eduardo A . Bustamante López
Subject: Re: How to deal with errors in <()?
Date: Sat, 7 Mar 2015 18:01:18 -0600
User-agent: Mutt/1.5.20 (2009-12-10)

> But I am wondering if there is a walkaround to deal with errors in
> <(). The ideal behavior should be that if there is a error in <(),
> then we should not consider commandA is executed correctly even if its
> return status is 0.
Again, address your questions to help-bash.

you can use:

CommandB | CommandA, and consult the PIPESTATUS array.

Or, you can do:

mkfifo Fifo
CommandB > Fifo & Bpid=$!
CommandA < Fifo
if wait "$Bpid"; then
 echo CommandB was successful
 echo CommandB failed

reply via email to

[Prev in Thread] Current Thread [Next in Thread]