![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need some help..Comparison | bluesilo | Shell Programming and Scripting | 0 | 02-23-2008 04:43 PM |
| Comparison of 2 strings | Retribution | Shell Programming and Scripting | 2 | 12-06-2006 08:35 AM |
| date comparison | dkr123 | Shell Programming and Scripting | 2 | 07-07-2006 10:09 PM |
| dir comparison help | ghazi | Shell Programming and Scripting | 5 | 12-20-2004 05:54 PM |
| comparison | cnf | Filesystems, Disks and Memory | 2 | 05-14-2002 02:52 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
multiple comparison in awk
I have an input file. Each line in it has several characters. If the first three characters of the line is '000' or '001' or '002' or '003', I need to print it in output. How can I do this in awk.
I am able to do if the search string is only one (let us say 000). cat <filename> | awk 'substr($0,1,3)=="000" {print}' How do I search for multiple matches? Is there an or condition that I can put after the == sign? |
![]() |
| Bookmarks |
| Tags |
| awk multiple comparison |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|