Chinaunix首页 | 论坛 | 博客
  • 博客访问: 427122
  • 博文数量: 103
  • 博客积分: 5010
  • 博客等级: 大校
  • 技术积分: 971
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-11 17:22
文章分类
文章存档

2008年(77)

2007年(26)

我的朋友

分类:

2007-12-08 11:12:38

1.cat -s filename
2.[xxxx@localhost test]$ sed -e '/^$/{
> $!N
> /^\n$/D
> }'  filename
$!N:对最后一行不进行(N)操作,也就是出来最后一行的意思

man sed:
n N    Read/append the next line of input into the pattern space.
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.

阅读(670) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:su和ps1变量的关系

给主人留下些什么吧!~~