Linux: Why should text files should end with a newline

 

 

 

wc -l will not count a final "line" if it doesn't end with a newline.

 

Because a file (or stream) of zero lines can be distinguished from a file of one empty line.  

 

https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline

posted @ 2022-10-02 02:54  ascertain  阅读(25)  评论(0)    收藏  举报