Re: Timeout for a script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, 2008-11-12 at 05:37 -0500, William L. Maltby wrote:
> On Wed, 2008-11-12 at 11:54 +0200, Jussi Hirvi wrote:
> > How could I make a script time out after nn minutes, if it's not finished by
> > then?
> ><snip>

> Do "man bash" and search for "trap". For those not familiar, it can be a
> little confusing, but it's well worth the effort, in terms of results
> and learning.

<*sigh*>

Well, it seems that bash doesn't have some of the stuff ISTR from the
original *IX stuff (builtin alarm? not sure anymore). Anyway, a google
for "bash alarm trap" led to this and there are lots more. This was just
the first and may not be the best for your needs.

http://steve-parker.org/sh/trap.shtml

Anyway, sans "alarm", a trap, sleep, SIGUSR* or SIGINT combination should
do nicely.

HTH
-- 
Bill

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux