pipefail doesn't work on NetBSD or FreeBSD

Gary E. Miller gem at rellim.com
Sat Oct 13 17:59:47 UTC 2018


Yo Hal!

On Fri, 12 Oct 2018 21:53:30 -0700
Hal Murray via devel <devel at ntpsec.org> wrote:

> Context is de-bashing tests/option-tester.sh and
> tests/python3-tester.sh

Ouch.  That is supposed to be the way to de-bash on *BSD.

> FreeBSD 11.1-RELEASE-p4 (GENERIC) #0: Tue Nov 14 06:12:40 UTC 2017
> 
> /bin/sh
> $ set -o pipefail
> set: Illegal option -o pipefail

Here is the generic problem:

  ./waf configure --out=$DIR $2 2>&1 | tee    $DIR/test.log

The scripts run something (./waf configure in this case), and put the
output into a pipe to log it.

Then next, there is a need to see if any part of the pipeling
failed.  But /bin/sh on *BSD only reports if the last part
of the pipeline failed.  tee rarely fails.

"set -o pipefail" is supposed to return fail to $? if any part
of the pipeline failed.

Any ideas how to do that?


RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20181013/7ced252b/attachment.bin>


More information about the devel mailing list