Reputation: 47
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"
Upvotes: 0
Views: 127
Reputation: 113904
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
Upvotes: 1