Unix loop failing :

Unix loop failing :

 

  

I am at the last hurdle in my script :

#-------------------------- CronJob for Mialing
Reports ---------------------
#set -v on
cd /u01/sendss/mail
for fle in `cat dirsearch.list`
do
echo $fle
cd $fle
ls -l | grep *.Now > tmp.out
emailnow=`cat tmp.out |wc -l`
if [$emailnow -ne 0 ]
then
type=`tail -1 *.info`
attach=`head -1 *.info`
echo $type
echo $attach
cat *.list > tmplist.out
emailist=`cat tmplist.out |wc -l`
if [$emailist -ne 0 ]
then
for mailname in `cat tmplist.out`
do
uuencode $attach $attach > report.doc
echo $mailname
echo $attach
mailx -s "SENDSS OUTPUT FILE REPORT" $mailname << EOT
~r report.doc
"$type"
EOT
done
fi
fi
done


We need to loop through each directory at /u01/sendss/mail and
then process the mailing of reports to individual email addresses in a
mailing list within each directory

Its failing at -
cd $fle where it says

$ ./mailreps.sh
mmwr
PLAIN TEXT
MMWR.DAT
[Email Address Removed] 9121/565293
DynamicRep
./mailreps.sh: DynamicRep: does not exist

$ cat dirsearch.list
mmwr
DynamicRep
CancerRep
LeadRep
NewUser
shutdown
Epinfo
hl7Rep
DuplicateRep

It works fine and sends mail from "mmwr" but fails to loop in directoriers
down under "mmwr"


Any ideas what's wrong - Any help would be greatly apprciated

TIA

Ankur Shah
Oracle DBA
DHR-GA

Oracle LazyDBA home page