#!/bin/bash

# demo the trap of an interrupting signal

trap 'rm -f my_tmp_file_$$' INT
echo creating file my_tmp_file_$$
date > my_tmp_file_$$
count=1;
echo "press control c to interrupt"
while [ -f my_tmp_file_$$ ] 
do 
    echo File exists
    if ((  $count > 10 ))

      then rm -f my_tmp_file_$$
     break 
    fi
    sleep 1

    count=$(( $count + 1 ))
done
echo The file no longer exists


