shell script to count the number of lines in a text file without using wc command. code example Example: shell count number of lines $ wc -l < /dir/file.txt 3272485