Skip to main content
added 2 characters in body
Source Link
slackmart
  • 329
  • 2
  • 12

For replace the "name" word with the "something" word, use:

sed "s/\(<[a-z]*><\<username><\!\[[A-Z]*\[\)name\]/\1something/g" file.xml 

That is going to replace all the occurrences of the specified word.

So far all is outputted to standard output, you can use:

sed "s/\(<[a-z]*><\<username><\!\[[A-Z]*\[\)name\]/\1something/g" file.xml > anotherfile.xml 

to save the changes to another file.

For replace the "name" word with the "something" word, use:

sed "s/\(<[a-z]*><\!\[[A-Z]*\[\)name\]/\1something/g" file.xml 

That is going to replace all the occurrences of the specified word.

So far all is outputted to standard output, you can use:

sed "s/\(<[a-z]*><\!\[[A-Z]*\[\)name\]/\1something/g" file.xml > anotherfile.xml 

to save the changes to another file.

For replace the "name" word with the "something" word, use:

sed "s/\(<username><\!\[[A-Z]*\[\)name\]/\1something/g" file.xml 

That is going to replace all the occurrences of the specified word.

So far all is outputted to standard output, you can use:

sed "s/\(<username><\!\[[A-Z]*\[\)name\]/\1something/g" file.xml > anotherfile.xml 

to save the changes to another file.

Source Link
slackmart
  • 329
  • 2
  • 12

For replace the "name" word with the "something" word, use:

sed "s/\(<[a-z]*><\!\[[A-Z]*\[\)name\]/\1something/g" file.xml 

That is going to replace all the occurrences of the specified word.

So far all is outputted to standard output, you can use:

sed "s/\(<[a-z]*><\!\[[A-Z]*\[\)name\]/\1something/g" file.xml > anotherfile.xml 

to save the changes to another file.