Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在文本文件中替换/或\?我试图“逃脱”这些角色,但到目前为止没有成功
echo '/// \\' | sed 's////some_text/'
显然行不通。
谢谢 BM
echo "\\\message\//" | sed 's;[\/];REPLACEMENT-TEXT;g'
如果您不想更改分隔符,那么这个
sed 's/[\\/]/U/g' temp.txt