Skip to content

Instantly share code, notes, and snippets.

@prkstaff
Created June 27, 2019 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prkstaff/ec422798b8a10da7cd3b1fb559564b51 to your computer and use it in GitHub Desktop.
Save prkstaff/ec422798b8a10da7cd3b1fb559564b51 to your computer and use it in GitHub Desktop.
Bash script wait untill user press ctrl+c
#!/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