![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| regular expression [^ ] | iengca | Shell Programming and Scripting | 9 | 06-18-2008 10:45 AM |
| Regular expression Help | Harikrishna | Shell Programming and Scripting | 3 | 06-11-2008 09:20 AM |
| regular expression | jaber87 | Shell Programming and Scripting | 3 | 06-05-2008 04:07 AM |
| regular expression (.*?) | uttamhoode | Shell Programming and Scripting | 7 | 06-04-2008 05:11 AM |
| Regular Expression + Aritmetical Expression | Z0mby | Shell Programming and Scripting | 2 | 05-21-2002 11:59 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Regular expression in AWK
Hello world, I was wondering if there is a nicer way to write the following code (in AWK): Code:
awk '
FNR==NR&&$1~/^m[24689]$/{tok1=1}
FNR==NR&&$1~/^m10$/{tok1=1}
' my_file
In fact, it looks for m2, m4, m6, m8 and m10 and then return a positive flag. The problem is how to define 10 thanks to regular expresions? Is there a way do a list of possible values, like "{2,4,6,8,10}"? Let me know, Thanks |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|