in reply to watching longstanding processes ?
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 }
|
|---|