Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sorry about the n00b question but why is this an option? Is there any caveats to not ending a file with a line break?

share|improve this question
    
This isn't a question about Apple hardware or software. You might try asking on Super User. –  Nathan Greenstein Jul 27 '11 at 1:07
    
So asking a question about a Mac OS X only application is not valid here? It has to be strictly Apple? Really? –  racl101 Jul 27 '11 at 1:10
    
Ok, well thanks Nathan for pointing me in the right direction. –  racl101 Jul 27 '11 at 1:20
    
Questions about third-party software for Mac OS X are on-topic. I closed your question because I think it deals more with general computer behavior (text files) than with Macs specifically. But, your question does involve software for Mac OS X. So, I see your point. If you want, I'll reopen the question for you. Sorry for the confusion. –  Nathan Greenstein Jul 27 '11 at 1:48
    
The reason for the option is buried in history, in old Unix programs which did not cope well with text files without a final newline. It's not unique to Mac OS, so the answers are probably better on another site, e.g. stackoverflow.com/questions/729692/… –  Alan Shutko Dec 2 at 16:33

1 Answer 1

This is probably because some other users of files require complete lines

e.g. C code will complain if there is no newline at the end of file - see this SO question

and one main use of Bbedit etc is programming

So the reason is not really specific to the Apple editors mentioned but more for what use the files is made of.

Also see the comment to that question

Not really the reason, but it's very annoying if you cat a file and it does not have a trailing newline as the new shell prompt will appear after the last line of the file (i.e. not in column 0)

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.