jobs: Implement pipefail option

With the pipefail option set, a pipeline's exit status is the exit
status of the rightmost command that failed, or zero if all commands

This is planned for inclusion in the next revision of POSIX [1],
although the details are yet to be finalised. The semantics of this
implementation are the same as those proposed in [2], which have also
been adopted by the BSD shells.


Signed-off-by: Herbert Xu <>
4 files changed