a little out of my comfort zone and have practically gotten what I want but awk seems determined to send a message via std error which is problematic and annoying. Basically trying to get a list of virtual host names from nginx config files like this:
$ awk -F" " '/./ { if ( match ( "^server_name$", $2 ) ) print $1 }' /opt/nginx/sites/*.conf \ | grep -v server_name | grep -v ';' | grep -v '}'
and the list of virtual host names is perfect except that I get this line first...
awk: (FILENAME=/opt/nginx/sites/ids.conf FNR=55) fatal: Unmatched ( or (: /($host/
and I can't seem to dismiss it and I definitely don't want it in my data scrape.
Anyone know how to prevent this? (yes, there are lines in the file that say 'if ($host = something) {'