a=0 while read line do a=$(($a+1)); echo $a; done < "myfile" echo "Final line count is: ...
www.linuxquestions.org