Created
May 25, 2022 13:21
-
-
Save eesa1980/2853c2a62bf2186ac4e443a3cb4181d9 to your computer and use it in GitHub Desktop.
Exit bash script on failure #bash #script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG | |
trap 'echo "\"${last_command}\" Error: pipeline failed with exit code $?."' EXIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment