Is there any way to time out a unix command?
 
Its something like this... I want my PerlPgm <might_hang.pl> to be killed by the shell (sh/bash/csh) if my PerlPgm fails to finish off by 300 elapsed seconds.
 
Something like
 
<timeout_shell_command> -timeout 300 might_hang.pl
 
This should execute might_hang.pl normally but if might_hang.pl fails to finish off by 300 elapsed secs, it should kill the might_hang.pl process.
 
I know that this can be achieved from inside might_hang.pl using alarms, but I needed to achieve that through a bourne shell i.e. the invoker of the Perl program (might_hang.pl).
 
Any thoughts about how this can be achieved...?
 
Thanks,
Arijit
 
 


Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.
_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to