I have written a shell script to initiate three background process in the same time. In shell script I am trying to wait for all children to finish their job and then the parent job to terminate. But, with some reason I see the the sleeping processes never awakes.
echo "Starting $1 instances" >> $logfile
for i in `seq 1 $1`
do
/usr/bin/php index.php name&
done
echo "Waiting for all $l instances to complete \n" >> $logfile
wait
echo "All $instances scripts completed" >> $logfile