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
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...
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
___
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
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?
> 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
>
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
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
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
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,
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
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
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
13 matches
Mail list logo