server_name awk für nginx

awk '/^\s*server_name/ {f=1} f {p=$NF;sub(/;$|server_name/,"",p);print p} /;$/ {f=0}' files

links

social