LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-12-2010, 06:49 PM   #1
sharky
Member
 
Registered: Oct 2002
Posts: 396

Rep: Reputation: 37
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?
 
Old 04-12-2010, 08:50 PM   #2
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,633

Rep: Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958
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.
 
Old 04-13-2010, 02:55 PM   #3
sharky
Member
 
Registered: Oct 2002
Posts: 396

Original Poster
Rep: Reputation: 37
This is solved by moving to version 3.1.7.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using GAWK in Java SnagglezMaw Programming 3 05-28-2009 03:53 PM
gawk help.... visitnag Linux - Newbie 1 04-12-2008 12:55 PM
where is curl and gawk ???????? bozart ROCK 11 10-23-2005 11:41 PM
gawk question luxpops Programming 1 09-12-2004 05:46 AM
FS=? in gawk realos Programming 2 05-28-2003 08:30 PM


All times are GMT -5. The time now is 07:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration