FreeBSD sh getting set -o pipefail


Jilles Tjoelker has just commited this change to FreeBSD sh:

sh: Add set -o pipefail

The pipefail option allows checking the exit status of all commands in a pipeline more easily, at a limited cost of complexity in sh itself. It works similarly to the option in bash, ksh93 and mksh.

This is awesome, especially if you’re like me and don’t install bash. pipefail is an invaluable sanity check and troubleshooting flag for scripts.

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person in bios. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.