-
-
Save Romero027/81770c8562b1ad1cd9343ebba65bfe1e to your computer and use it in GitHub Desktop.
Use DEBUG Trap to step through a bash script line by line - by Julia Evans
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
#!/bin/bash | |
# See https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/ for a in-depth discussion | |
trap '(read -p "[$BASH_SOURCE:$LINENO] $BASH_COMMAND?")' DEBUG | |
var=2 | |
echo $((var+2)) | |
for i in 1 2 3 4 5 | |
do | |
echo "Welcome $i times" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment