Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Dec 2006 16:26:30 -0700
From:      "Kelly Jones" <kelly.terry.jones@gmail.com>
To:        freebsd-questions@freebsd.org, linuxusersgroup@googlegroups.com
Subject:   Unix/sh/bash/tcsh command to limit clock time for program?
Message-ID:  <26face530612261526r3954a4d6m972feba654b332b9@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Is there a Unix or shell command that runs a given program for n
seconds and then terminates it (unless the program takes less than n
seconds to run, obviously)?

I know ulimit can limit a program's CPU time and sh's TIMEOUT variable
can limit idle time at the shell prompt, but how to limit a program's
clock time?

There's an expect script that seems to do what I want
(http://expect.nist.gov/example/timed-run), but is there something
more basic and "built-in" to either sh/bash/tcsh or Unix?

-- 
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?26face530612261526r3954a4d6m972feba654b332b9>