bugcy013
10/3/2014 - 1:41 PM

Unix - Wait for a running process (not a child process) to finish and do something

Unix - Wait for a running process (not a child process) to finish and do something

Unix - Wait for a running process (not a child process) to finish and do something

Just find the process id of the process you want to wait for and replace that with 12345 in below script.  Further changes can be made as per your requirement.



#!/bin/sh
while [ -e /proc/12345 ]
do
echo "12345 PID still running" >> /home/parv/waitAndRun.log
sleep 600
done

echo "12345 PID finished running" >> /home/parv/waitAndRun.log
/usr/bin/waitingScript.sh