Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: nawk doesn'...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 6 Topic 2165 of 2236
Post > Topic >>

Re: nawk doesn't match mac addresses with quantifiers

by Robert Langdon <not@[EMAIL PROTECTED] > Feb 15, 2008 at 09:14 AM

On 2008-02-14 03:27:05 +0100, Ed Morton <morton@[EMAIL PROTECTED]
> said:

> 
> I don't believe nawk supports RE intervals (e.g. {5}). GNU awk supports
> it if you use the --re-interval option. /usr/xpg4/bin/awk is, I think, a
> POSIX awk and so should support it like any POSIX awk would.
> 
> gawk --re-interval
'/^([[:xdigit:]][[:xdigit:]]:){5}[[:xdigit:]][[:xdigit:]]/ {
> print $1
> }'
> 
> or:
> 
> awk 'BEGIN{x="[[:xdigit:]]"; d=x x; a=d":"d":"d":"d":"d":"d}
> $1 ~ a { print $1 }'
> 
> Regards,
> 
> 	Ed.

Dear Ed,

You are fully right. The standard awk in the default path /usr/bin on 
Solaris seems to be a non gawk version. Using /usr/xpg4/bin/awk works 
fine with the quantifier {5}. Nowadays, gawk should be the default 
version on a modern Unix, but hey, without such capers Solaris wouldn't 
be Solaris.

So, many many thanks for your swift hint.

Cheers,

Rob.




 6 Posts in Topic:
nawk doesn't match mac addresses with quantifiers
Robert Langdon <Not@[E  2008-02-14 00:00:27 
Re: nawk doesn't match mac addresses with quantifiers
Ed Morton <morton@[EMA  2008-02-13 20:27:05 
Re: nawk doesn't match mac addresses with quantifiers
Robert Langdon <not@[E  2008-02-15 09:14:31 
Re: nawk doesn't match mac addresses with quantifiers
gazelle@[EMAIL PROTECTED]  2008-02-15 14:09:11 
Re: nawk doesn't match mac addresses with quantifiers
usenetpersongerryt@[EMAIL  2008-02-15 08:46:30 
Re: nawk doesn't match mac addresses with quantifiers
gazelle@[EMAIL PROTECTED]  2008-02-15 20:01:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 1:43:16 CDT 2008.