Signal Trapping Using Variables

You can easily catch signals thrown at your process and set variables accordingly:

trap "TEST=blah" HUP

TEST=
while true
do
	echo .
	sleep 1
	echo -n $TEST
	TEST=
done

trap -
Feedback is always welcome! If you'd like to get in touch with me concerning the contents of this article, please use Twitter.