0
我沒有找到與sed
和匹配模式使用標誌的方式。如何在mac上使用'sed'標誌?
我試圖給我我的國旗。但我不明白它是如何工作的。
$ sed -i '' -n '/[email protected]/i d' res.txt
sed: 1: "/[email protected]/i d": command i expects \ followed by text
所以我想匹配[email protected]而[email protected]
的-i ''
僅供--in-file (without cache)
的d
是刪除。
那麼我怎樣才能使用標誌,並最終他們多個?在文檔中我發現它就是這樣,但它似乎根本不工作。
你在做什麼,用文件res.txt中的內容替換[email protected]? – UltrasoundJelly
使用-i標誌將允許文件被修改,而不是輸出到標準輸出。 – UltrasoundJelly
GNU sed對於[不區分大小寫的匹配項]具有'I'標誌(https://stackoverflow.com/documentation/sed/3120/address-and-address-range/13753/lines-matching-regular-expression-pattern#t = 201610260907523706883)..也不能確定在OSX上.. – Sundeep