I usually use the read command to read an input file to the shell script line by line. An example code such as the one below yields a wrong result if a new line isn\'t inser
Below code with Redirected "while-read" loop works fine for me
while read LINE do let count++ echo "$count $LINE" done < $FILENAME echo -e "\nTotal $count Lines read"