1
如何使用通配符在Linux中刪除特定模式?如何使用通配符在Linux中刪除特定模式
test07cel20: ((host=test07db04.com,port=1832,community=public,(host=test07db02.com,port=1832,community=public),(host=172.186.100.63,port=162,community=public,type=ASR))
我想刪除從上面的線(host=172.186.100.63,port=162,community=public,type=ASR)
和172.186.100.63
,public
將改變通過的情況下(我的意思是變量)的情況下,所以尋找一些方法通配符。
此外,這種模式將始終存在於行的末尾。在某些情況下,type=ASR
將爲type=asr
。因此,如果您有任何想法可以涵蓋以上所有情況,請從行中刪除host=*,port=162,community=*,type=ASR
模式。任何幫助是極大的讚賞。
預期輸出是
(host=test07db04.com,port=1832,community=public),(host=test07db02.com,port=1832,community=public)
用適當的格式編輯您的文章,並添加預期的輸出。 – Inian
請查看[editing-help](http://stackoverflow.com/editing-help)。 – Cyrus
您的修改使其不清楚:它是一行代碼,應該顯示爲一行代碼(帶有四個縮進代碼)。 –