#!/bin/bash
# Example of how to trap a user pressing ^c during script execution
echo "Starting...
Please wait until I have completed"
trap message INT
function message() {
echo "Please do not use CTRL^C, I have files open"
sleep 5
}
for i in `seq 10 -1 0`; do
echo -ne "\r $i seconds remaining "
sleep 1
done
echo "I have finished"