We are having a problem launching multiple scripts through a batch command.

The cron will only start the first script. When we kill the first one, then the 2nd script called in the batch command starts and so it goes with each script.

Here is a sample of the scripts we are running:

xloop=Y
while [ $xloop = "Y" ] ; do

#D/S 22
MEDDIR=/usr2/data22
dset=22
MDIRDATA="$MEDDIR/mmmerge"
cd $MDIRDATA
flist="*.csv"
for i in $flist ; do
cd $MEDDIR
if [ -f "$MDIRDATA/$i" ] ; then
prtfname="`basename $i .csv`.txt"
echo "Processing file $i `date`" >$MEDDIR/archive/mmrpfs.out #clear the file if exists
cd $BASEMED
dloadsrv $dset -p$MEDPTR D:mmrpfs.dmc -#$MEDUNUM $MEDPWD 0 N $i -bg
sleep 180 # Allow 3 minutes
dloadsrv $dset -p$MEDPTR D:mmrlog.dmc -#$MEDUNUM $MEDPWD P F mmrpfs L -bg
sleep 60 # Allow 1 minute
cd $MEDDIR/archive
mv mmrpfs.out $prtfname
mutt -s $prtfname -a $prtfname ds$dset@pfspays.local < /usr2/meddata/interface_body.txt
fi
done
sleep 5



The only difference between the scripts would be the MEDDIR and the dset.

Any help would be greatly appreciated!!