Possible Duplicate:
What's the point in adding a new line to the end of a file?
What is considered better behaviour: to leave the last letter of the last line to be the last byte of a file, or to press Enter at the end to let there be a lf
? Why?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityPossible Duplicate:
What's the point in adding a new line to the end of a file?
What is considered better behaviour: to leave the last letter of the last line to be the last byte of a file, or to press Enter at the end to let there be a lf
? Why?
(Copied from my comment on the question, as requested.)
See Why should files end with a newline? - Stack Overflow. The "TL;DR": POSIX says so, and it's pretty logical to have a line end in and end-of-line character.
See the linked Stack Overflow question for practical consequences.
I always put an empty line at the end. I think it looks cleaner, and some programs choke on the last line if there isn't a newline.