`set -o pipefail` OR check `$PIPESTATUS` in the rcCheck function... https://unix.stackexchange.com/questions/14270/get-exit-status-of-process-thats-piped-to-another But I've had a problem making the latter work on OS X