![]() |
|
|
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 |
| To identify filename in which having match PATTERN | cedrichiu | Shell Programming and Scripting | 14 | 03-23-2008 08:05 PM |
| Print last occurrence if first field match | Raynon | Shell Programming and Scripting | 9 | 03-13-2008 03:28 AM |
| match field between 2 files | phamp008 | Shell Programming and Scripting | 8 | 01-23-2008 07:46 AM |
| how to use pattern match with grep | rei | UNIX for Dummies Questions & Answers | 5 | 01-05-2007 04:33 AM |
| pattern match and substitution, can you help? | frustrated1 | Shell Programming and Scripting | 4 | 02-20-2006 08:48 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
how do i pattern match a field with awk?
hi,
let's say $numbers = "324 350 587" an so on... what i'm trying to do is this: awk -v numbers="$numbers" '{if (numbers ~ /$2/) print $0, "bla bla"}' file # file looks like this: 214 ..... 215 ... 216 .... 250 ... 324 325 ... 350 something ... ... 587 ... i want to do something with the lines that contain the numbers in the variable numbers, and something else with the lines that match other patterns. thanks.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|