很多^M在代码行的后面
在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