vodkadrinker
Technical User
If run the following command from the command line it works ok.
awk -F ";" '$2 == "123"' /tmp/testfile
However if I set a variable first it errors awk: 0602-562 Field $() is not correct.
myvalue="123"
awk -F ";" '$2 == $myvalue' /tmp/testfile
cat testfile
aa;1;mmm
bb;123;zzz
aa;123;ppp
cc;222;yyy
Any help would be greatfull.
Thanks,
VD
awk -F ";" '$2 == "123"' /tmp/testfile
However if I set a variable first it errors awk: 0602-562 Field $() is not correct.
myvalue="123"
awk -F ";" '$2 == $myvalue' /tmp/testfile
cat testfile
aa;1;mmm
bb;123;zzz
aa;123;ppp
cc;222;yyy
Any help would be greatfull.
Thanks,
VD