[CentOS] awk awk

John Doe jdmls at yahoo.com
Fri Dec 7 10:26:10 UTC 2012


From: Craig White <craig.white at ttiltd.com>

> but I have some conf files which look like
> 
>   server_name {
>     domain1.com
>     domain2.com
>     big.server.com
>     }
>   ;

What about something like:
  grep -P "^server_name {\n[^}]*" nginx.conf | grep -v "{\|}"

JD



More information about the CentOS mailing list