I am working on a script which basically loop through a directory for files and does a word count for each file and if the file has more than 1 row then writes that filename to a log file.
1. Loop thorugh a directory and pick up files
2. do a word count on each file
3. write the filename to a logfile only if the file has more than 1 record.
I have a written some code and it works but it is writing all files to logfile
for file in `ls`
Count=`echo cat $file | wc -l`
echo " my count is $Count"
if [ "$count" -gt 1 ];
echo $file >> /home/log.txt
echo "there is no file to write"