I have a .env file containing the following:
{
"Config" : {
"host" : "XX.XXX.XX.XXX" ,
"port" : 3019
}
}
In a bash script I have an a variable $myNewIP
. I want to replace the IP in the file with the value of my variable with an awk
command.
I have tried
awk '/host/{sub(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})}1 .env
I am prompted that I have syntax errors. I thought this should work. What is wrong with the command?