I'm running a GCE VM with Ubuntu 18, and having an issue with a perl command.
export ip_addr=`hostname -i`
echo "set \$ip_addr_priv \"{my_ip_address}\"" | sudo perl -n -e 's/(\$ip_addr_priv) +"\{([a-zA-Z0-9_]+)\}"/\1 "$ENV{ip_addr}"/g; print;'
When I run this in the command line, I get the following output:
set $ip_addr_priv ""
Instead of something like this:
set $ip_addr_priv "127.0.0.1"
What am I doing wrong?