Run this script. Hit CTRL-C 6 times, and see what happens, and how it works.
# Declare function to handle CTRL-C signals
count=$((count + 1))
echo "INT signal received $count times."
if [ $count -ge 5 ] ; then # After 5 INT's
# reset signal handling to default.
trap - INT
# Install handler for INT signals (CTRL-C)
trap 'signal_func' INT
# Loop doing nothing for demo.
while true ; do
echo "Woken up"
# we never get here.