Count lines and use if then ksh

view full story

http://www.unix.com – I try to count number of lines of a data.txt file and then if number of lines is greater than 1 then email me the file. I could not find what is wrong with my code, hope you can point out the mistake i made Code: #! /bin/ksh count =`cat /from/file/data.txt | wc -l` if [[ $count -gt 1 ]]; then mailx -s "Duplicate " [email protected] < /from/file/data.txt fi sabercats:~/tools/cgi-bin> test.ksh =2 sabercats:~/tool/cgi-bin> I only see =2 what is this? this is count =`cat /from/file/data.txt | wc -l` How it got out there and no mail for me? Thanks (HowTos)