I have an xml file that I want to configure using a bash script. For example if I had this xml:
<a>
<b>
<bb>
<yyy>
Bla
</yyy>
</bb>
</b>
<c>
<cc>
Something
</cc>
</c>
<d>
bla
</d>
</a>
(confidential info removed)
I would like to write a bash script that will remove section <b>
(or comment it) but keep the rest of the xml intact. I am pretty new the the whole scripting thing. I was wondering if anyone could give me a hint as to what I should look into.
I was thinking that sed could be used except sed is a line editor. I think it would be easy to remove the <b>
tags however I am unsure if sed would be able to remove all the text between the <b>
tags.
I will also need to write a script to add back the deleted section.