@simontatham@muvlon@Rob_Russell@hendric if y'all didn't know, set -o pipefail is also very handy - it means that earlier command's exit codes won't be overridden by later commands that have been piped. That is $? is non-zero if any command in the pipeline is.
So fail | grep blah still results in $? being 1 (or whatever else)