<br><br><div class="gmail_quote">On Tue, Jun 22, 2010 at 8:47 PM, Chris F.A. Johnson <span dir="ltr"><<a href="mailto:chris-E7bvbYbpR6jSUeElwK9/Pw@public.gmane.org">chris-E7bvbYbpR6jSUeElwK9/Pw@public.gmane.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br>
<br>
</div></div>wait=5 ## seconds before timing out<br>
<div class="im">suspend_wl & ## put function into the background<br>
<br>
</div>while ps $! > /dev/null 2>&1 && [ $wait -gt 0 ]<br>
do<br>
sleep 1<br>
wait=$(( $wait - 1 ))<br>
done<br>
ps $! > /dev/null 2>&1 && kill $!<br><br></blockquote><div>ah, that's super! trying to understand it, does this mean:<br><br>while (ps $! gives a nonzero result) and ($wait is greaterthan 0)<br>sleep, reduce wait by 1<br>
and afterwards<br>check if $1 is still running, and kill it <br><br>looks great, thanks much. i didn't really know that ps returned an exit value!<br><br>matt<br></div></div>