LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   gawk 3.1.3 vs gawk 3.1.1 (http://www.linuxquestions.org/questions/programming-9/gawk-3-1-3-vs-gawk-3-1-1-a-801632/)

sharky 04-12-2010 05:49 PM

gawk 3.1.3 vs gawk 3.1.1
 
Using gawk 3.1.3 in Linux
echo 'This should match abc_123_abc' | gawk '/ab\w+bc/ {print "It matches"}'

returns "It matches"

Using gawk 3.1.1 in HPUX
echo 'This should match abc_123_abc' | gawk '/ab\w+bc/ {print "It matches"}'

returns nothing.

I don't know if this is a version thing or an architecture thing.

Any ideas?

grail 04-12-2010 07:50 PM

How about something simple like:
Code:

echo 'This should match abc_123_abc' | gawk '{print $2}'
If it does I guess you need to build your regex by pieces to see what is broken.
\w appears as a standard piece of awk and its variants.

sharky 04-13-2010 01:55 PM

This is solved by moving to version 3.1.7.


All times are GMT -5. The time now is 09:11 AM.