sendmail=10
if [ $sendmail -eq 10 ]
then
echo "The word count is $sendmail"
fi
After that adapt to your needs doing something like this:
sendmail=$(wc -l rightfit_balancing_count.dat | awk '{print $1}')
if [ $sendmail -eq 0 ]
then
echo "This is the word count" | mail -s "Current word count" counting_words@shell_learner.com
fi
wc -l rightfit_balancing_count.dat will give you the number of records ( truly, newlines) in the file "rightfit_balancing_count.dat" and not the content of the line.