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