#!/bin/bash

function trap_control_signal()
{
  echo
  echo "ATTENTION:"
  echo "The \"kill -9\" signal was caught"
  echo "Now exiting Bash Shell Script!!!"
  echo
  echo
  exit 0
}

trap trap_control_signal 9

clear
echo "Entering sleep mode"
echo "Run this in background ( i.e. $0 & )"
echo "and then kill -9 PID"
echo
echo "Note: you cannot trap kill -9 signal"
echo "      so this won't work..."
sleep 1000
