Search the web
Sign In
New User? Sign Up
geeksthatgawk · for GNU Awk questions & discussions
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
how to use a variable in a "if" with regular expression   Message List  
Reply | Forward Message #90 of 221 |

Hi,

I would to do this in a gawk script:

BEGIN {
as="188.772.11.11"
while (getline <"../datas"){
split($0,s,";")
if(/$as;/) { print $0 }
}
}

but it fails.
Of course if I write
if(/188.772.11.11;/) { print $0 }
then it's ok.

Thank you in advance
Bruno





Thu Dec 4, 2003 11:08 am

bruno_bury
Offline Offline
Send Email Send Email

Forward
Message #90 of 221 |
Expand Messages Author Sort by Date

Hi, I would to do this in a gawk script: BEGIN { as="188.772.11.11" while (getline <"../datas"){ split($0,s,";") if(/$as;/) { print $0 } } } but it fails. Of...
bruno_bury
Offline Send Email
Dec 4, 2003
11:08 am

Hi Bruno... I'm confused. If you are asking about awk, there's no $. 'as' I take it is a string RegExp ? Well, "." is a meta-character, or special character....
William
chiron_sun
Offline Send Email
Dec 28, 2003
1:05 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help