html - Linux文件换行问题?
阿神
阿神 2017-04-17 16:24:06
0
2
553

在Linux上执行:echo 'aaaaaa' > test.htm
然后在浏览器查看test.htm源码,会有一行空行;

用vim查看只有一行;

将此文件下载下来用SublimeText查看有两行;

如何在Linux上生成一行的文件?什么原因造成的?

阿神
阿神

闭关修行中......

reply all (2)
伊谢尔伦
echo -n aaaaaa > test.htm

Vim will hide a newline at the end of the file by default. You can use xxd to see the last one0a

    小葫芦
    //对比下md5值 $ echo -n 123456|md5sum |cut -b-32 e10adc3949ba59abbe56e057f20f883e $ echo 123456|md5sum |cut -b-32 f447b20a7fcbf53a5d5be013ea0b15af $ echo 123456 | hd #可以看到末尾多了`0a`字符 >>> md5(123456) => "e10adc3949ba59abbe56e057f20f883e"
      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!