0

i have to replace the simple xml tag

<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>

by

<connector name="http" protocol="HTTP/1.1" scheme="http"
     socket-binding="http"
     enabled="false"/>

how i can achieve this using sed command

i tried to replace by simple sed command as i am beginner using

sed 's/connector name="http" protocol="HTTP\/1.1" scheme="http" socket-binding="http"/connector name="http" protocol="HTTP\/1.1" scheme="http" socket-binding="http" enable="false"' abcd.xml`

but i am getting message

command garbled: s/connector name="http" protocol="HTTP\/1.1" scheme="http" socket-binding="http"/connector name="http" protocol="HTTP\/1.1" scheme="http" socket-binding="http" enable="false"

1 Answer 1

1

The s/old/new/ command is missing the final slash. Try:

sed 's/connector name="http" protocol="HTTP\/1.1" scheme="http" socket-binding="http"/connector name="http" protocol="HTTP\/1.1" scheme="http" socket-binding="http" enable="false"/' abcd.xml
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.