私が含まれているファイルがあります。今、私はそれを見てするようにライン「DocumentRoot /var/www/html/
」文字列を挿入し
下の単語「world
」を追加しよう
hello
test1
DocumentRoot /var/www/html/
test2
hey
をこのように:上記の行は、私はこれをしようとしたが、それディ 「/
」が含まれているため
hello
test1
DocumentRoot /var/www/html/
world
test2
hey
それは私のために難しいです動作しないd次の
sed 's/DocumentRoot /var/#www/#html/#\ /DocumentRoot /var/#www/#html/#\nworld/' file
をそれは完全に間違って出力
hallo
test1
var/var/www/html/
test2
hey
'sed '@regex @ replace @'' – sat
SOのドキュメントに基づいて質問を閉じることができるはずです:P https://stackoverflow.com/documentation/sed/1096/substitution/12280/using-different-delimiters#t = 201611030947028728011 – Sundeep
解決策を検索しようとしましたか、この質問は頻繁に尋ねられますか? – 123