Alarm clock Set Timeout For A Shell Command

Originally published at:

How can I run a command called foo, and have it timeout/abort after 10 seconds under GNU/Linux running bash shell or script? How do I run the command under an alarm clock?

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki