help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] behavior of -o pipefail


From: Christof Warlich
Subject: Re: [Help-bash] behavior of -o pipefail
Date: Mon, 29 Oct 2018 22:16:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Am 29.10.2018 um 20:58 schrieb Chet Ramey:
On 10/29/18 3:54 PM, Greg Wooledge wrote:
On Mon, Oct 29, 2018 at 08:49:32PM +0100, Christof Warlich wrote:
With piplines being made up of such well-behaving filters, it would
still be beneficial to see the first error instead of the last one. Can
we agree with that?
If you care about that, just use the PIPESTATUS array variable instead of
pipefail.  Pipefail is only intended to report "something bad happened",
not to help you pinpoint exactly which bad thing happened to whom.  It's
a sledgehammer, not a sewing needle.
You're not wrong. `set -o pipefail' is intended to fill the functionality
gap caused by $? only using the exit status of the last element of the
pipeline. If you want more, there are tools available.

Sure, PIPESTATUS always comes to rescue. I just hoped for making the sledgehammer to become a bit more versatile, but maybe you're right that it's not worth it.




reply via email to

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