shell scripting, how to auto-timeout?

RW rwmaillists at googlemail.com
Thu Jan 22 13:27:59 PST 2009


On Thu, 22 Jan 2009 12:41:14 -0800
Nerius Landys <nlandys at gmail.com> wrote:


> /usr/local/bin/java PipeGenerator $* &
> sleep 1
> <kill the java command if not already killed>
> 
> Also with the above code I would be waiting for 1 second even if the
> java process finished sooner.  But that is a penalty I'm willing to
> pay, unless there is a more elegant solution.

sleep 1 && <kill the java command> &



More information about the freebsd-questions mailing list