Unix/sh/bash/tcsh command to limit clock time for program?

John Levine johnl at iecc.com
Tue Dec 26 16:45:26 PST 2006


>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)?

  some-command& sleep 42; kill -9 $!

R's,
John


More information about the freebsd-questions mailing list