Skip to content

Instantly share code, notes, and snippets.

@dannyduc
Created September 21, 2012 18:11
Show Gist options
  • Save dannyduc/3763023 to your computer and use it in GitHub Desktop.
Save dannyduc/3763023 to your computer and use it in GitHub Desktop.
Trap CTRL-C in bash
trap ctrl_c INT
function ctrl_c() {
echo "** Trapped CTRL-C"
}
for i in `seq 1 5`; do
sleep 1
echo -n "."
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment