I want to replace value inside a tag in an xml file using sed.
xxxx-SS
I want to replace xxxx-SS with some she
Using xml/html parsers is the right way to manipulate xml/html documents. Don't use sed/awk tools for such cases.
xmlstarlet solution:
xmlstarlet ed -u "//version[1]" -v $ver test.xml
ed
- edit mode
-u
- update action
//version[1]
- xpath expression to select the first version
tag
-v $ver
- the new value for selected node