#! /bin/bash
if [ $# -lt 2 ]
then
echo "Usage : $0 Signalnumber PID"
exit 2
fi
case "$1" in
1) echo "Sending SIGHUP signal"
kill -SIGHUP $2
;;
hup) echo "Sending SIGHUP signal"
kill -SIGHUP $2
;;
HUP) echo "Sending SIGHUP signal"
kill -SIGHUP $2
;;
2) echo "Sending SIGINT signal"
kill -SIGINT $2
;;
3) echo "Sending SIGQUIT signal"
kill -SIGQUIT $2
;;
9) echo "Sending SIGKILL signal"
kill -SIGKILL $2
;;
kill) echo "Sending SIGKILL signal"
kill -SIGKILL $2
;;
KILL) echo "Sending SIGKILL signal"
kill -SIGKILL $2
;;
*) echo "Signal number $1 is not processed"
;;
esac
exit
# relevant /usr/local/bin files:
exit_codes.txt
file_count
get_options.txt
signal
signals.txt
traps.sh
syntax highlighted by Code2HTML, v. 0.9.1