Use vim to view some file, "^M" appears at the end of every line, there are two methods to deal with it.
1:in Vim
:%s/<ctrl-v><ctrl-m>//g<enter>
:w
or
:%s/<ctrl-v><enter>//g<enter>
:w
it means %s/^M//g.
2:in terminal
$dos2unix filename
Use vim to view some file, "^M" appears at the end of every line, there are two methods to deal with it.
1:in Vim
:%s/<ctrl-v><ctrl-m>//g<enter>
:w
or
:%s/<ctrl-v><enter>//g<enter>
:w
it means %s/^M//g.
2:in terminal
$dos2unix filename