How to get the file size and count of a table using shell scripting?

Hi there,
im a beginner to the shell scripting.i trying to extract a table from a db(IMD) and i have to get the count of that table and size of the file.
can you help me out how to write the shall scriping for the above query.

Is this homework? If so, please post it here.

Otherwise, please say what you have tried, and where you are struggling.

1 Like

thanx fro your response.
Yes it is a kinda home work.
im trying to write the code for extracting the data from the table into the flatfile.
after that i have to get the count of the table and size of the file.
im successful with extracting the data.but struggling with the next two things
i tried in this way but its not showing the proper o/p.

rec_cnt = $(wc -l < $FNAME) 
echo 'Total num of records in the file is `$rec_cnt`' >>sample.del

size= $( stat -c %s  sample.del)
echo 'Size of the file is `$size`' >>sample.del

so i want to know how to write it in different way...

so can you please help me out .....