in reply to Re: Re: SIGINT in system() with shell metachars
in thread SIGINT in system() with shell metachars
I suggest using the 'trap' shell statement to generate a non-standard exit status from signal delivery. There are some timing quirks that may hit you if the child is doing things like saving and restoring tty modes, but otherwise it works (I just tested it on Linux):
system(q[ trap 'exit 77' 2; foo | bar ]); if (($? >> 8) == 77) { wow_i_got_a_sigint(); }
The shell's 'trap' statement is a handy feature, seldom used.
-- Chip Salzenberg, Free-Floating Agent of Chaos
|
|---|