Skip to main content
1 of 4
maihabunash
  • 7.2k
  • 22
  • 68
  • 80

how to match parameter and replace the value after "=" separator

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 unknown value on specific parameter

for example

we want to match the "VIP_IP" 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

Expected results

more file.txt
VIP_IP=192.17.200.100
maihabunash
  • 7.2k
  • 22
  • 68
  • 80