我试图找到这三行:
<!--
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
-->
并替换为:
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
当我尝试
sudo sed -i 's:<!-- <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> -->:<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />:' /myfile.xml
它找不到它,我也尝试将\ n放入其中,但仍然无法正常工作:
sudo sed -i 's:<!--\n <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />\n -->:<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />:' /myfile.xml
这些不会引发任何错误,只是不会取消注释。任何建议将帮助谢谢!