Hello,
I have this code:
#!/bin/sh
awk -v val="........." 'BEGIN{FS=OFS=" ";c=0}
NR==FNR&&d==0{a[$0]=$0; c++;next}
FNR==(NR-c){b[FNR]=val;next}
{if(1234 in a){print "okay"}}
{print $1}' listi fpr.11 grn
that is working (awk find the value in the table "a" and return "okay" followed by 1234)
and when I am using:
#!/bin/sh
awk -v val="........." 'BEGIN{FS=OFS=" ";c=0}
NR==FNR&&d==0{a[FNR]=$0; c++;next}
FNR==(NR-c){b[FNR]=val;next}
{if(1234 in a){print "okay"}}
{print $1}' listi fpr.11 grn
awk returns me "1234" but not "okay", meaning that it did not find 1234 in my list (but of course 1234 is in the list!!).
Does someone has any idea why I have this problem?
Thanks