** Reply to message from John Oliver <[EMAIL PROTECTED]> on Thu, 10 Apr
2008 16:51:21 -0700

> It looks like the installer is exiting back to the shell and then
> launching new processes, so terminating the line with && isn't helping
> me.  I may use sleep as a kludge to get around this, but am wondering if
> there's a neater answer that will be dependant upon actual completion
> and not just waiting around for some arbitrary period of time, which may
> turn out to be too long (or not long enough) in the future.

couldn't you poll the process list and check the name of the process you want
to wait
for and when it is gone, it is finished and you can then start your next
process?

#!/bin/bash

PROC_NAME=speedcrunch
PROCESS=`ps -fe | grep $PROC_NAME | wc -l`
# using test of 1 since the grep command adds 1 entry
while [ $PROCESS -gt 1 ] ; do
  echo proc=$PROCESS;
  sleep 2
  PROCESS=`ps -fe | grep $PROC_NAME | wc -l`
done

Doug


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to