I want to replace some digit numbers with regex and then do some mathematics by sed, however, my solution lost the original quotation, I already checked the arguments of echo and try with -E but it doesn't work as well, anybody can help?
source file content
cat f1.txt
<AB port="10000" address="0.0.0.0" adpcpu="1"/>
my command
sed -r 's/(.*)(port=\")([0-9]+)(\".*)/echo \"\1\2$((\3+50))\4\"/ge' f1.txt
result
<AB port=10050 address=0.0.0.0 adpcpu=1/>
The resulting content missed the quotation