Created
June 27, 2019 18:52
-
-
Save prkstaff/ec422798b8a10da7cd3b1fb559564b51 to your computer and use it in GitHub Desktop.
Bash script wait untill user press ctrl+c
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
#!/bin/bash | |
trap ctrl_c INT | |
function ctrl_c() | |
{ | |
echo "Trap: CTRL+C received, exit" | |
exit | |
} | |
read -r -d '' _ </dev/tty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment