特定值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