I want to do match multiple continuous lines in a file and then replace it with new multiple continuous lines. For example:
Pattern:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
to be replaced with :
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
acceptCount="450" maxConnections="10000"
redirectPort="8443" server=" " />
Even though here few keywords are common in both the paragraph but just consider them different.
I tried with following but could not get success:
sed -i 's/<Connector port="8080" protocol="HTTP\/1.1" \nconnectionTimeout="20000" \nredirectPort="8443" \/>/<Connector port="8080" protocol="HTTP\/1.1" \nconnectionTimeout="20000" \nacceptCount="450" maxConnections="10000" \nredirectPort="8443" server=" " \/>/g' server.xml
How can i achieve above.
Thanks.