Hi Friends,
Have a script which invoke same shell script with different argument in background (usually runs couple of hours)
In above scenarios,
1. would like to check if all the above script execution has finished or not
2. In a loop with sleep/interval?
3. Once all finished, call a function and exit
I dont want to use sleep which increases the overall time for some reason in the script. Instead would like to use grep and check in a loop. pls help what is the best way to achieve this
e.g
ps -ef | grep backgroundDummyProc | grep -v grep
if [ $? -eq 1 ]
then
echo "Not running"
else
echo "running"
fi
Thanks in advance
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.