Chinaunix首页 | 论坛 | 博客
  • 博客访问: 420933
  • 博文数量: 136
  • 博客积分: 5351
  • 博客等级: 少校
  • 技术积分: 1446
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-29 15:46
文章存档

2013年(2)

2012年(18)

2011年(116)

分类: Python/Ruby

2012-05-04 21:30:32

1.使用&命令附加修改字符
[root@acer shell_learning]# cat   quote.txt |  grep  "nurse"
The local nurse Miss P.Neave was in attendance
[root@acer shell_learning]# sed  -n 's/nurse/"Hello" &/p'   quote.txt
The local "Hello" nurse Miss P.Neave was in attendance
[root@acer shell_learning]# sed -n  's/nurse/& "Hello"/p' quote.txt
The local nurse "Hello" Miss P.Neave was in attendance
由此可以知道&代替原来的字符“nurse”,如此一来,它前后要加字符就好说了。
阅读(896) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~