Signal Trapping Using Functions

You can easily catch signals thrown at your process and call a function which needs to be defined beforehand:

function sigtrap() {
	echo sigtrap
}

trap "eval sigtrap" HUP

while true
do
	echo .
	sleep 1
done

trap -