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
ps -ef | grep backgroundDummyProc | grep -v grep
if [ $? -eq 1 ]
echo "Not running"
Thanks in advance