免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6138 | 回复: 5
打印 上一主题 下一主题

关于sed 中-n和-e选项方面的使用 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-07-26 14:33 |只看该作者 |倒序浏览
新手学习sed,看了wingger mm的“shell基础12篇”,但有个问题还是不太灵清,就是在使用-n和-e的选项上,不明白-n和-e到底是什么含义。希望各位大虾能讲解一下。多谢拉!

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
2 [报告]
发表于 2005-07-26 14:54 |只看该作者

关于sed 中-n和-e选项方面的使用

-n, --quiet, --silent

              suppress automatic printing of pattern space

       -e script, --expression=script

              add the script to the commands to be executed

论坛徽章:
0
3 [报告]
发表于 2005-07-26 16:56 |只看该作者

关于sed 中-n和-e选项方面的使用

To 楼上:能否用中文说明一下?

对文件quote.txt:
The honeysuckle band played all night long for only $90.
It was an evening of splendid music and company.
Too bad the disco floor fell through at 23:10.
The local nurse Miss P.Neave was in attendance.

怎样打印出每行和每行的行号?

论坛徽章:
0
4 [报告]
发表于 2005-07-27 10:04 |只看该作者

关于sed 中-n和-e选项方面的使用

自己ding一下,哪位大虾给解答一下吧,现在给卡在这里喽

论坛徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亚冠之浦和红钻
日期:2015-06-23 19:10:532015亚冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16赛季CBA联赛之山东
日期:2016-01-31 18:25:0515-16赛季CBA联赛之四川
日期:2016-02-16 16:08:30程序设计版块每日发帖之星
日期:2016-06-29 06:20:002017金鸡报晓
日期:2017-01-10 15:19:5615-16赛季CBA联赛之佛山
日期:2017-02-27 20:41:19
5 [报告]
发表于 2005-07-27 10:14 |只看该作者

关于sed 中-n和-e选项方面的使用

http://phi.sinica.edu.tw/aspac/reports/96/96005/sed_sec_2.html

看2.1与2.5

如果有时间通篇看几遍吧?

论坛徽章:
0
6 [报告]
发表于 2005-07-27 10:41 |只看该作者

关于sed 中-n和-e选项方面的使用

多谢楼上的,你给的链接打开后都是乱码不知道是怎么回事?
不过我在wingger mm给的一个链接上看到这样的说明,我觉得解释得很清楚了:
http://www.chinalinuxpub.com/doc/oreillybookself/unix/sedawk/ch02_03.htm

The -e option is necessary only when you supply more than one instruction on the command line. It tells sed to interpret the next argument as an instruction. When there is a single instruction, sed is able to make that determination on its own.

谢谢大家的帮忙了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP