I need update specific value in xml in automatic way by bash script. My xml file has a lot of similar line like:
<xml>
   <main>
      <buildElement name="test_one" version="" path="" />
      <buildElement name="test_two" version="" path="" />
   </main>
</xml>
I need find element name "test_one" and edit version. I am trying this, but it's not help:
Expected output:
<xml>
   <main>
      <buildElement name="test_one" version="some_value" path="" />
      <buildElement name="test_two" version="" path="" />
   </main>
</xml>
I am trying get this by xmlstarlet and sed, but is not working f.e:
xmlstarlet edit --update '//xml/main/buildElement/name="test_one"/version' --value 'some_value' myXML.xml
