How do I print all complete lines of a file? By 'complete' I mean only the ones that end with newline character.
grep treats EOF as line delimiter, so
grep '^.*$' file will print the last line even if there's no newline at the end of file.
The whole problem comes from parsing log files: we need to somehow be sure that the last entry was completely logged - i.e. it ends with newline.