Subject: Re: shell question...
To: None <j+nbsd@2006.salmi.ch>
From: John Darrow <John.P.Darrow@wheaton.edu>
List: netbsd-help
Date: 02/01/2006 19:47:41
Jukka Salmi <j+nbsd@2006.salmi.ch> wrote:
>Chavdar Ivanov --> netbsd-help (2006-01-31 16:37:23 +0000):
>> try
>> 
>> ( sleep 30 >/dev/null 2>&1 & ) >/dev/null 2>&1
>> 
>> but then you have to find the pid of the sleep process... $! is no good.
>
>Unfortunately that's exactly why I can't do this: I need to be able to
>kill the sleep process before it returns.

Try the following, produces no shell job output for me under 3.0 /bin/sh
and /bin/ksh:

mypid=$(sleep 30 >/dev/null 2>&1 & echo $!)
[...]
kill $mypid

jdarrow