new=`zcat file.xml.gz | grep :133 | grep 192* | tail -n 1`
&& gunzip file.xml.gz && sed -i 's#$new#<value>
tcp://192.164.1.5:133</value>#g' file.xml && gzip file.xml
The output of new=<value>tcp://192.164.1.23:133</value>
Here I need to replace the IP 192.164.1.23 with 192.168.1.5
The script will work if I give tcp://192.164.1.23:133 instead of $new. But I want to read it from $new.
Any help......