#!/bin/bash

# Define the signal handler.
# Note that the signal handler does NOT end with an exit
signal_handler()
{
  echo "Hasta la vista, baby!"
}

# Trap the SIGHUP, SIGINT, SIGQUIT, SIGKILL and SIGTERM signals
# Note that SIGKILL(9) cannot be trapped. This is silently ignored
# by the trap command.
trap signal_handler 1 2 3 9 15

# Start an endless loop which displays the date every second.
while true
do
  date
  sleep 1
done
