I need to read (store in variable) and then change the online_hostname key value in XML using bash/shell script.
<?xml version="1.0" encoding="UTF-8" ?>
<bzinfo>
<myidentity online_hostname="testdevice-air_2022_01_25"
bzlogin="me@abc.com" />
</bzinfo>
I am able to read the value but not able to change it.
cat test.xml | grep '<myidentity ' | sed -E 's/.*online_hostname="?([^ "]*)"? .*/\1/'