I have a configuration that is disabled because its embedded in a comment. My Sed is deleting the line beneath my pattern, but the line with the pattern gets deleted too. Can I tell Sed to keep the current line? Or just delete the line before and after the found pattern.
Input
... <!-- <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> --> ... Sed
# sed -e '/<Connector port="8009" protocol="AJP\/1.3" redirectPort="8443" \/>/,+2d' server.xml Output
... <!-- ... Wish to be Output:
... <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> ...