in reply to SIGINT in system() with shell metachars
system("/bin/true |sleep 60; kill -`expr \$? / 64` \$\$"); print "sysret: $?\n";
The shell runs the pipeline, calculates what signal the process died from, and kills itself with that signal. If the process didn't die from a signal, it kills itself with signal 0, which does nothing.
|
|---|