Missing The Last Line in a Filesuggest change
The C standard says that files should end with a new line, so if EOF comes at the end of a line, that line may not be missed by some commands. As an example:
$ echo 'one\ntwo\nthree\c' > file.txt$ cat file.txtonetwothree$ while read line ; do echo "line $line" ; done < file.txtonetwo
To make sure this works correctly for in the above example, add a test so that it will continue the loop if the last line is not empty.
$ while read line || [ -n "$line" ] ; do echo "line $line" ; done < file.txt one two three