I have the following string in a file:
<Product Id="*" Name="NAME" Language="1033" Version="1.2.3.4" Manufacturer="Manufacturer" UpgradeCode="12345">
I want to replace the last number field in the version value (i.e. "4") using bash command (sed?) with a new number. I want to be able to change this to any other number that I pass. I tried using:
sed -i -e "s#Version=\"\([0-9]\)\.\([0-9]+\)\.\([0-9]+\)\.\([0-9]+\)\"#Version=\"\1\.\2\.\3\.10\"#g" <filename>
but this didn't work.
sed, it's really not the best tool for the task unless you've got nothing else. Which is unlikely, considering you're dealing with XML to begin with.