![]() |
|
|
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 |
| Combine multiple columns from multiple files | martva | Shell Programming and Scripting | 5 | 12-02-2008 09:23 AM |
| replace multiple lines in multiple files | unihp1 | Shell Programming and Scripting | 1 | 09-21-2008 09:47 AM |
| Adding Multiple Lines to Multiple Files | dayinthelife | Shell Programming and Scripting | 2 | 06-04-2008 12:50 PM |
| Unix log treatment | farzolito | Shell Programming and Scripting | 2 | 03-03-2004 05:41 AM |
| Searching multiple files with multiple expressions | Anahka | Shell Programming and Scripting | 6 | 01-07-2004 06:24 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hello, My code is like that: Code:
awk -v f=92238 '$1~/^m2/{tok1=1;next}tok1==1&&$0~f{tok1=0;print $NF}' inp.[1-9] inp.1[0-5]
Eahc of the "inp.*" file is like that: Code:
...
m1 xxxx xxxx
92238 897987
xxxx xxxx
m2 xxxx xxxx
92238 123435
xxxx xxxx
...
The problem is that it returns me both the value in m1 and m2 (I asked only for the values in m2). Any idea why my script does not return the expected result? Thanks |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|