sed


echo billing.application|sed 's/\(.*\.\)\(.*\)/\1/'| sed 's/.$//'
billing

 

解释: \( \) 括起来的,后面可以通过 \1 来指定第一个括起来的,\2指定第2个括起来的

 

  •  

&保存发现模式,以便重新调用它

 echo "hello"|sed 's/he/ab&/'  

abhello

 

&就表示 之前配置到的he 

posted on 2012-08-09 14:14  山本二十八  阅读(172)  评论(0编辑  收藏  举报

导航