To handle the timeout you could use alarm, or non-blocking IO on TRACE and count seconds yourself.my $some_host = ... my $pid = open TRACE, "traceroute $some_host |"; while (<TRACE>) { if (/some string/) { close TRACE; kill 15, $pid; last; } # other processing here } # rest of script here }
In reply to Re: watching longstanding processes ?
by moot
in thread watching longstanding processes ?
by bugsbunny
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |