perl -ne "END { print $. }" # wc -l perl -de 1 # used as bc but could be anything :-)