background jobs exit status
i need to execute 5 jobs at a time in background and need to get the exit status of all the jobs i wrote small script below , i'm not sure this is right way to do it.any ideas please help.
$cat run_job.ksh
#!/usr/bin/ksh
####################################
typeset -u schema_name=$1
count=0
cat $home/tablist.list|
while read table
do
sas $table.sas &
count=`expr $count + 1`
echo $count
rc=$?
if (( $rc > 0 )); then
echo " executing the n't succes for $table

rc "
exit 1
fi
cnt=$(jobs -l | wc -l )
if [[ $cnt -le 5 ]] ; then
continue
else
wait
#echo "in the wait mode"
fi
done
exit 0
last edited by grepme : 7 hours ago at 07:29 pm.