Created
November 23, 2020 14:03
-
-
Save rumkin/f9ffb7e7353cee874edde6db9e7cd4f5 to your computer and use it in GitHub Desktop.
Trap command before execution
This file contains 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
debug() { | |
echo "IT'S A TRAP: $BASH_COMMAND" | |
} | |
trap 'debug' DEBUG | |
echo 'HELLO' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment