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
DONE=false until $DONE do read line || DONE=true echo $line done < blah.txt
How to use `while read` (Bash) to read the last line in a file if there’s no newline at the end of the file?