Under UNIX-like OSes, a text file consists of a series of lines, each
of which ends with a `newline` character (`\n`). A file that is not
empty and does not end with a `newline` is therefore considered not to
be a text file.
Because of this, utilities that are supposed to operate on text files
may not cope well with files that don't end with a `newline` (e.g.: they
might ignore the text after the last `newline`).
Adding the `newline` character at the end of the file ensures that users
won't encounter any odd behavior when using it.
Reference/Source: http://unix.stackexchange.com/a/18789.