We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
link: https://medium.com/@dirk.avery/the-bash-trap-trap-ce6083f36700
#!/bin/bash set -e trap 'catch $? $LINENO' EXIT catch() { echo "catching!" if [ "$1" != "0" ]; then # error handling goes here echo "Error $1 occurred on $2" fi } simple() { badcommand echo "Hi from simple()!" } simple echo "After simple call"
The text was updated successfully, but these errors were encountered:
Summary:
Trapping on EXIT Forces the shell to exit,
whereas trapping on ERR will allow future commands to run after the running the trap command 😯
Sorry, something went wrong.
http://redsymbol.net/articles/bash-exit-traps/
No branches or pull requests
link: https://medium.com/@dirk.avery/the-bash-trap-trap-ce6083f36700
The text was updated successfully, but these errors were encountered: