DOS与UNIX文件风格互转

来源:互联网 发布:centos与linux区别 编辑:程序博客网 时间:2024/06/05 00:26

DOS与UNIX文件风格互转

DOS文件行以\r\n结尾,UNIX文件行以\n结尾。

DOS --> UNIX :    sed 's/.$//g' dosfile > unixfile                tr -d "\r" dosfile > unixfileUNIX --> DOS :    sed 's/$/\r/g' unixfile > dosfile
原创粉丝点击