Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Why do some of the more technical apps require newlines at the end of files? I've read it has something to do with diffs, but shouldn't diff be able to figure the relative positions of things out on its own?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Text file are composed of text lines, which are terminated with newlines (as opposed to being separated by newlines). So omitting the last newline technically makes the last line an incomplete text line.

share|improve this answer

I think it has more to do with appending to the end of the file. The convention is to have a newline at the end so that anything adding to the file doesn't have to worry about whether they need to make a break between the old content and the new.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.