O.K. I'm tired of writing BASH scripts. I've decided to jump wholesale
into Perl as any good Systems Engineer should, right? I'm running into
a bit of a problem: signal handling.
Let's say I want to run system application SYSAPP_A once for each
element in LIST_A, and if that were to fail, run SYSAPP_B for that
element. If I don't trap for signals, and I try to interrupt the Perl
script with CTRL-C (SIGINT), it kills either SYSAPP_A or SYSAPP_B and
then continues on looping over LIST_A elements.
What I want is for the Perl script to die unconditionally. So, I try this:
$SIG{INT} = sub { die "Um, I'm outta here!\n"; };
This kind of works, but if I hit CTRL-C during SYSAPP_A's run, it fails
and SYSAPP_B tries to execute. SYSAPP_A and SYSAPP_B are each called
with the "system" built-in.
What do I need to do to make sure the script dies unconditionally when
any child also receives an interrupt?
Chad