Hi Gurus,
How can i find background process is completed or not. I have mentioned my scenario below.
Actually Pr1 Process is running in back ground, i just want to know whether this process completed or not. I can come to know the process id by typing pid=$! but i want to trigger that pr1 process in back ground and then after 10 min i want to trigger Pr2 Process. Actually Pr1 Process will take around 2 Hr time. i don't want to wait till 2Hrs, by writing wait $pid where $pid=$!.
script:
*****
x=`1 2 3 4 5`
for y in $x
do
if [ $a -eq 0 ]
then
./$Home/script_1.sh &
pid_1=$!
wait $pid_1
elif [ $b -eq 0 ]
then
./$Home/script_2.sh &
pid_2=$!
wait $pid_2
fi
sleep 15
done
here n this case for every 15 sec i want to run the scripts which has completed its process. in this case first it will run script_1.sh then it will wait for the process to complete then it triggers the script_2.sh but i don' t want to wait till script_1.sh completes. For every 15sec i want too run which ever is free i.e if for after 45 sec script_1.sh is completed its processing the it shuld run.
Please help me on the same.