首页 > 系统服务 > 详细

shell提取数字

时间:2017-10-11 16:08:56      阅读:299      评论:0      收藏:0      [点我收藏+]

样本

/opt/abc/efg_hello_211/world/world

/opt/abc/efg-hello-2112/world/world


方法一.cat test.txt |grep "server"|awk -F‘/‘ ‘{print $4}‘|grep -o ‘[0-9]\{3,\}‘

方法二.cat test.txt |grep "server"|awk -F‘/‘ ‘{print $4}‘|awk -F ‘-|_‘ ‘{print $3}‘


本文出自 “未来时空” 博客,请务必保留此出处http://sjitwant.blog.51cto.com/3661219/1971428

shell提取数字

原文:http://sjitwant.blog.51cto.com/3661219/1971428

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!