sed replace xml tag
问题 I want to replace value inside a tag in an xml file using sed. <version> xxxx-SS </version> I want to replace xxxx-SS with some shell variable $ver . The final result should be <version>$ver</version> The sed command should also quit after replacing the first instance. So far I have been able to only append to the xxxx-SS and not been able to quit after the first match. sed 's#\(<version>\)*\(</version>\)#\1'$ver'\2#g' test.xml This only appends the value between -SNAPSHOT tag.Basically makes