$ zsh debug.sh
run "echo "1""? y
First command
run "echo "2""? y
Second command
run "echo "3""? y
Last command
Created
October 25, 2018 19:43
-
-
Save 0x3333/2c63b668295cb49579148c1a4065b4e8 to your computer and use it in GitHub Desktop.
Debug a ZSH Script - Ask for a confirmation before every command is issued
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
#!/usr/bin/zsh | |
TRAPDEBUG() { | |
read -q "?run \"$ZSH_DEBUG_CMD\"? " || setopt errexit | |
echo > /dev/tty | |
} | |
echo "First command" | |
echo "Second command" | |
echo "Last command" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment