tofrodos 初步学习笔记

1 . UNIX 下与 DOS 下回车键定义的不同--使用 man tofrodos 可以获得以下信息    DOS  text  files  traditionally  have  carriage return and line feed pairs as their newline characters while Unix text files have the line feed as their newline character .(意思是,dos文本文档因袭传统, 把ca
摘要由CSDN通过智能技术生成

1 . UNIX 下与 DOS 下回车键定义的不同
--使用 man tofrodos 可以获得以下信息
DOS  text  files  traditionally  have  carriage return and line feed pairs as their newline characters
while Unix text files have the line feed as their newline character .(意思是,dos文本文档因袭传统, 把
carriage return 和line feed 的组合作为换行符;然而,unix 文本文件把line feed 作为换行符)

--通常把carrige return 和 line feed 分别写作 CR 和 LF ; 其中, CR 本用于将光标回退到当前行首;LF用于向下一行
  CR 字符形式'/r' LF字符形式'/n';ascii 码值分别为10进制的13 和 10

--使用cat命令并加以 -A 选项可以呈现所有不可打印字符 ,其中包括回车符(newline character(s))
  dos文件回车符显示为 ^M$
  unix文件回车符显示为  $

  unix文件回车符用两个字符表示 /r/n
  dos 文件回车符用一个字符表示 /n


2 . unix 与 dos 文本文档格式转换工具
--名称 todos fromdos 函数(ubuntu环境)
--安装方法   $sudo apt-get install tofrodos
--函数格式   todos [options] [file]
             fromdos [options] [file]
--函数选项
  -b  将源文件file备份位file.bak 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值