the perl one liner command to replace Value in file is simple:
perl -i 's/oldval/newval/g' file.txt
but what should be the perl one liner syntax in case we want to replace the value on specific parameter ( value is after "=" seperator
Example
We want to match the VIP_IP string and replace the value after "=" separator with other value as 192.17.200.100 ( with perl one liner syntax )
more file.txt
VIP_IP=172.17.200.15
if [[ $VIP_IP = $HOST_IP ]]
then
.
.
.
Expected results
more file.txt
VIP_IP=192.17.200.100
if [[ $VIP_IP = $HOST_IP ]]
then
.
.
.