Re: [CentOS] awk awk

2012-12-07 Thread Steve Brooks
On Fri, 7 Dec 2012, mark wrote: > On 12/06/12 19:23, Steve Brooks wrote: >> >>> Why are you doing all that piping and grepping? And the -F" " confuses >>> me...oh, I see. First, whitespace is the default field separator in awk. >>> Then, are you asking if there's a line with a "." in it, or just a

Re: [CentOS] awk awk

2012-12-07 Thread mark
On 12/06/12 19:23, Steve Brooks wrote: > >> Why are you doing all that piping and grepping? And the -F" " confuses >> me...oh, I see. First, whitespace is the default field separator in awk. >> Then, are you asking if there's a line with a "." in it, or just any >> non-whitespace? If the latter...

Re: [CentOS] awk awk

2012-12-07 Thread John Doe
From: Craig White > 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 ___

Re: [CentOS] awk awk

2012-12-06 Thread Les Mikesell
On Thu, Dec 6, 2012 at 3:48 PM, Craig White wrote: > > not that I was looking for someone to write it for me but that works only > when the nginx.conf looks like > > server_name domain1.com domain2.com big.server.com; > > which I actually didn't need to use awk to parse as I already handled tho

Re: [CentOS] awk awk

2012-12-06 Thread yonatan pingle
On Fri, Dec 7, 2012 at 2:23 AM, Steve Brooks wrote: > > > Why are you doing all that piping and grepping? And the -F" " confuses > > me...oh, I see. First, whitespace is the default field separator in awk. > > Then, are you asking if there's a line with a "." in it, or just any > > non-whitespace?

Re: [CentOS] awk awk

2012-12-06 Thread Steve Brooks
> Why are you doing all that piping and grepping? And the -F" " confuses > me...oh, I see. First, whitespace is the default field separator in awk. > Then, are you asking if there's a line with a "." in it, or just any > non-whitespace? If the latter... mmm, I see, you *really* don't understand >

Re: [CentOS] awk awk

2012-12-06 Thread m . roth
Craig White wrote: > On Dec 6, 2012, at 1:59 PM, m.r...@5-cent.us wrote: >> Craig White wrote: >>> On Dec 6, 2012, at 1:34 PM, m.r...@5-cent.us wrote: >>> You rang? Craig White wrote: >>> Definitely have little to no understanding of awk but… >>> >> Ok, I just d/l an nginx.conf file

Re: [CentOS] awk awk

2012-12-06 Thread Craig White
On Dec 6, 2012, at 1:59 PM, m.r...@5-cent.us wrote: > Please stop top posting, Craig. > > Craig White wrote: >> >> On Dec 6, 2012, at 1:34 PM, m.r...@5-cent.us wrote: >> >>> You rang? >>> >>> Craig White wrote: a little out of my comfort zone and have practically gotten what I want

Re: [CentOS] awk awk

2012-12-06 Thread m . roth
Please stop top posting, Craig. Craig White wrote: > > On Dec 6, 2012, at 1:34 PM, m.r...@5-cent.us wrote: > >> You rang? >> >> Craig White wrote: >>> 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 >>> p

Re: [CentOS] awk awk

2012-12-06 Thread Craig White
Definitely have little to no understanding of awk but… /./ suppresses empty lines (records in awk speak) the gsub looks interesting but your code just tosses syntax errors and yes Les, the >2 /dev/null definitely redirected the awk squawk to where it belonged Craig On Dec 6, 2012, at 1:34 PM,

Re: [CentOS] awk awk

2012-12-06 Thread m . roth
You rang? Craig White wrote: > 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

Re: [CentOS] awk awk

2012-12-06 Thread Les Mikesell
On Thu, Dec 6, 2012 at 2:07 PM, Craig White wrote: > 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 f

[CentOS] awk awk

2012-12-06 Thread Craig White
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_na