[Bug 224270] Get exit status of process that's piped to another: set -o pipefail is missing for /bin/sh

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Dec 27 22:32:17 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224270

--- Comment #5 from Jilles Tjoelker <jilles at FreeBSD.org> ---
The pipefail option was proposed for POSIX at
http://austingroupbugs.net/view.php?id=789 but this discussion seems to be
stalled. Apart from the SIGPIPE issue, it was pointed out that shell options
interact poorly with functions since they are dynamically scoped (for example,
  set -o pipefail; cmd1 | cmd2 | cmd3; r=$?; set +o pipefail
not only affects this pipe's exit status, but also everything done by cmd1,
cmd2 and cmd3 if they are functions). I will try to get this moving again.

However, the implementation of set -o pipefail is simple and doing without it
or a similar feature in scripts is complicated.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list