3 # (Unix only) Write an infinite loop program that catches signals
4 # and reports which signal it caught and how many times it has seen
5 # that signal before. Exit if you catch the INT signal. If you can
6 # use the command-line kill, you can send signals like so:
10 # If you can't use the command-line kill, write another program to
11 # send signals to it. You might be able to get away with a Perl
14 # $ perl -e 'kill HUP = 12345'>
21 foreach (qw (int hup usr1 usr2)) {
26 printf("%s: %d\n", $signal, ++$n);
27 if ($signal eq 'INT') {