Q&A
Q&AHow do you preserve exit failures through a shell pipeline?
Use pipefail where supported and handle expected no-match statuses separately from actual errors.
Read the concise answer
Many shells report only the last pipeline command status. In Bash, `set -o pipefail` makes a pipeline fail when a stage fails. grep status 1 often means no match rather than a tool error, so scripts should distinguish that expected result from status 2 or an upstream failure.