特定值i有我可以通过只在命令行键入使用grep显示在命令行
checklicence
检查的产品的许可证。
它给了我输出:
Product License status
Parameters of license Sxxxxx--xxxxx--xxxxx4
Volume
Regular texts
Units: Pages
Quantity: 120000 per year
Remains: 107852 this year
我想找到有多少留的是有和打印。
所以我试图做
>checklicense |grep -i "Remains:"
我得到输出
>Remains: 107852 this year
但我只是想作为输出数107852
有什么办法如何做到这一点的?
我的grep版本是License GPLv3+: GNU GPL version 3
@Inian'许可证的GPLv3 +:GNU GPL版本3' – Shubham
查找我的回答如下,让我知道是否能解决你的问题的 – Inian
可能的复制(HTTP [正则表达式字符串之后和在太空中提取纯文本]:/ /stackoverflow.com/questions/18709439/regex-to-extract-only-text-after-string-and-before-space) – tripleee