#If checknew = empty then checknew =0 if [ checknew = ] then checknew="0" fi check=`cat file|wc -w` #check if file has been modified and send an email if [ $check -ne $checknew ] then echo ... mail -s "test" christor checknew=$check fi