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 @   ascertain  阅读(22)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2020-10-02 随机数生成类
2020-10-02 方法重载(overload) & 封装
2020-10-02 对象的销毁
2020-10-02 python 类属性装饰器
2020-10-02 python中lambda实现赋值和多语句 & 单行命令行中执行多语句
2020-10-02 monkeypath4python
2020-10-02 python 递归迭代目录
点击右上角即可分享
微信分享提示