Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2043052
  • 博文数量: 470
  • 博客积分: 10206
  • 博客等级: 上将
  • 技术积分: 5620
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-03 12:50
文章分类

全部博文(470)

文章存档

2012年(1)

2011年(18)

2010年(47)

2009年(404)

分类:

2010-03-10 12:31:52

D Delete up to the first embedded newline in the pattern space. Start next cycle,but skip reading from the input if there is still data in the pattern space.

那位朋友能给讲解下?
 
函数参数 D 表示删除 pattern space 内的第一行资料。其指令格式如下:

[address1,address2]D


对上述格式有下面几点说明 :

函数参数 D 最多配合两个地址参数。
函数参数 D 与 d 的比较如下 :
当 pattern space 内只有一数据行时 , D 与 d 作用相同。
当 pattern space 内有多行资料行时
D 表示只删除 pattern space 内第一行资料 ; d 则全删除。
D 表示执行删除后 , pattern space 内不添加下一笔数据 , 而将剩下的数据重新执行 sed script ; d 则读入下一行后执行 sed script。

阅读(1213) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~