I want to replace a value in XML file with sed: here is the origin line:
<ns3:myID>aaa:bb:cc:dd::123-sd3-7b</ns3:myID>
I want to replace the values between <ns3:myID>
and </ns3:myID>
.
I tried
sed -Ei - "s/(myID\>).*(<.*)$/\1${MY_NEW_VALUE}\2/" path.xml
it does replace the value, but it generates a new temp file which is not acceptable, can someone know a sed command line that can in-place replace the above value without generating any temp files?