remove ^M

dog 2004-07-08 08:58:04
hello,
I want to remove ^M in my file.how to use sed to do it?I tried that
sed -e 's/^M//g' yel.dat > new.dat
but failed.

I edited yel.dat in window, ^M appears at end of each line.I can do it in other way,but I want to learn sed.
...全文
56 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
core 2004-07-09
  • 打赏
  • 举报
回复
sed -e 's/^M//g' yel.dat > new.dat
^M is an character composed by Ctrl+V and Ctrl+M
dog 2004-07-09
  • 打赏
  • 举报
回复
thanks.
in my machine,I type ctrl+v and enter get ^M.
it works.

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧