Just for reference, this is really useful:
( cmdpid=$BASHPID; (sleep 10; kill $cmdpid) & exec some_command ) |
Update Apr 20, 2012 @ 16:54: As pointed in a comment by Timo Juhani Lindfors, if “some_command” exits early and the interval is long, another process can reuse its process number and get killed once the sleep runs out. Does anybody know a better way of doing that without using timeout from coreutils (better yet: using just bash)?
0sem comentários ainda