in reply to Re: Timing out backquoted executions
in thread Timing out backquoted executions

Thanks guys. Now I'm noticing though that when I do this, the process continues running. How can I be sure to terminate this process?

> cat perl.pl #!/usr/bin/perl eval { $SIG{ALRM} = sub { die "Timed out\n"; }; alarm(5); `perl -e 'while(1){sleep 1;}'`; alarm(0); }; print "Died with: $@\n"; > ./perl.pl Died with: Timed out > ps PID TTY TIME CMD 11551 pts/0 00:00:00 bash 11648 pts/0 00:00:00 perl 11651 pts/0 00:00:00 ps

Replies are listed 'Best First'.
Re^3: Timing out backquoted executions
by Joost (Canon) on Aug 02, 2007 at 20:19 UTC