Chinaunix首页 | 论坛 | 博客
  • 博客访问: 415404
  • 博文数量: 116
  • 博客积分: 7087
  • 博客等级: 少将
  • 技术积分: 1175
  • 用 户 组: 普通用户
  • 注册时间: 2005-02-19 23:32
文章分类

全部博文(116)

文章存档

2012年(1)

2011年(2)

2010年(10)

2009年(21)

2008年(18)

2007年(12)

2006年(21)

2005年(31)

我的朋友

分类:

2007-03-14 15:07:54

1. flow control
   sed support simple flow control
   use the keyword "b" to jump to a label,and beware of where you put the label.
2. the use of N
   when sed see a N, it reads the next line into the pattern buffer.
   then you can do substitute,delete with the pattern buffer.
 
the following code combines 2 lines into one as long as the first one ends with ";"

/;$/{
N;
s/;\n/;/
}

3. the usage of NF

   you have to add a '$' sign ahead of NF under HP-UX,otherwise you will never get what you want.

 

 

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