I'm trying to edit a tomcat configuration file using perl. I want to uncomment the following lines in an xml file. I tried it with perl, but it won't work.
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
This is what i got:
perl -i -pe 's~<!--\n <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"\n maxThreads="150" SSLEnabled="true" scheme="https" secure="true"\n clientAuth="false" sslProtocol="TLS" />\n -->~<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"\n maxThreads="150" SSLEnabled="true" scheme="https" secure="true"\n clientAuth="false" sslProtocol="TLS" />~' $CATALINA_HOME/conf/server.xml
Another question: can i find and replace a string with a regex?
Thanks for any help!