码迷,mamicode.com
首页 > 其他好文 > 详细

sed引用变量

时间:2015-05-09 06:37:55      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:双引号   hello   world   

#####sed在替换模式下必须要用双引号引起替换内容
[root@localhost ~]# A="how are you"
[root@localhost ~]# echo $Ahow are you
[root@localhost ~]# echo "hello world" | sed  "s/hello/$A/g"
how are you world


本文出自 “天道酬勤” 博客,请务必保留此出处http://8855546.blog.51cto.com/8845546/1649763

sed引用变量

标签:双引号   hello   world   

原文地址:http://8855546.blog.51cto.com/8845546/1649763

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!