Chinaunix首页 | 论坛 | 博客
  • 博客访问: 187107
  • 博文数量: 8
  • 博客积分: 1885
  • 博客等级: 上尉
  • 技术积分: 840
  • 用 户 组: 普通用户
  • 注册时间: 2005-09-26 20:15
文章分类
文章存档

2009年(8)

我的朋友
最近访客

分类: LINUX

2009-10-19 09:49:39

CR:Carriage Return(回车)

LF:Line Feed(换行)

windows use CR/LF to terminate line,*nix use LF,MAC uses CR.

if you tranfer windows file to unix.sometimes, you can see ^M at the end of each line in the file. ^M is CR sign in unix.

you can use tr or sed command to solve this problem.

windows -> Unix

tr -d '\r' < oldfile > newfile

sed 's/.$//'

Unix->windows

sed -e 's/$/\r/' myunix.txt > mydos.txt

in VIM

:set ff:show the file format.

:set ff=unix:set the file format to unix.

 

阅读(418) | 评论(0) | 转发(0) |
0

上一篇:about CR/LF

下一篇:没有了

给主人留下些什么吧!~~