ITeye博客

很多^M在代码行的后面

夜鸣猪 · 2012-04-06 05:11 · 编程语言 · Markdown

在git diff的时候发现 可能是Windows开发工具搞上来的,因为有不一样的换行回车 解决办法是


vim
:set fileformat=unix
:%s/^M//g
:%s/\r//g

:w

dos2unix

perl -pie 's/\r//g' filename.txt


sed s/\r// hello.txt > helloUNIX.txt
dos2unix hello.txt helloUNIX.txt
cat hello.txt | tr -d \r > helloUNIX2.txt


评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。