how read the flat files from shell scripting

We are using sybase data base and we have the data base name called MasterDB. The data baase MasterDB contains 100's of tables like sample1, sample2, sample3...etc...sample100
To take the count of every table we have to execute the following commands
use MasterDB //DB name
go //execute command in sybase
select count(*) from sample1 // command to find the count of table
go //execute the command

This is the way to take count. Likewise manually we have to take 100 tables count...we have to automates this though shell scripts.
What I did here is, I write all table names in the flat file and trying to read the flat files from the scripts
#!/bin/ksh
PATH=temp/flat_file
srv=sybaseserver
uid=operator
log=$LOGS/rowcount.log
pwd=`cat $SYBASE/.operatorpwd`
CP_CONN="-U$uid -S$srv -C3433 -b100000"
echo "count of table Started at: `date`" > $log
echo >> $log
echo "-------------------------------------------------------" >> $log
echo 'Setting table count..' >> $log
isql -U$uid -S$srv << EOF >> $log
$pwd
use customers
go
print 'taking count from tables..'
go
while read line
do
select count(*) from $customer_table \n
go
done < outfile.dat
i know its incorrect logic..pls help me onthis

I am closing this thread. It is a duplicate of a thread in the Shell Programming and Scripting forum.