x=0 cat file.txt | while read lin ; do x=$((x+1)); done