This post summarizes how to get the exit status from commands in a pipeline. Introduction How to Get Exit Statuses from a Pipeline Using PIPESTATUS Using set -o pipefail Conclusion References Introduction When you try to get the exit status of a pipeline using $?, by default, it only returns the exi…