Skip to content

Instantly share code, notes, and snippets.

@rumkin
Created November 23, 2020 14:03
Show Gist options
  • Save rumkin/f9ffb7e7353cee874edde6db9e7cd4f5 to your computer and use it in GitHub Desktop.
Save rumkin/f9ffb7e7353cee874edde6db9e7cd4f5 to your computer and use it in GitHub Desktop.
Trap command before execution
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