Nginx – awk find and replace with regex and environment variable
This is my text: set $domain_name some-not-important-name.com; I want to reach this: set $domain_name test.com; This is what I tried so far: DOMAIN_NAME=test.com awk '{ sub(/ set $domain_name(.*)/, " set $domain_name $DOMAIN_NAME;") }1' file current result: set $domain_name some-not-important-name.com Update…