#!/bin/bash
# call trapped in case Ctrl+C pressed
trap trapped INT
function trapped() {
echo "CTRL-C pressed"
}
while true; do
sleep 1
echo -n "."
done
Tuesday, February 7, 2012
Trap Ctrl C in Bash
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.