I have the XML code as follows
<root>
<list>
<pair name="id" Value="randomvalue" />
</list>
<list>
<pair name="place" Value="US" />
</list>
</root>
I need to change the Value(could be any value which we dont know) of the pair tag(whose name attribute is "id") to say "othervalue".
I have tried using:
sed -i 's|<pair name="id" Value="[a-zA-Z0-9_]+" />$|<pair name="id" Value="othervalue" />|g' file.xml
But it doesn't work