Following is my bash script. If I use varible oid to compare in awk, it doesnt show matching line.
oid="3586302804992"
SYMBOL_CSV_FILE="symbol/BAC"
awk -F, '$5 == $oid' "$SYMBOL_CSV_FILE"
echo "2nd"
awk -F, '$5 == "3586302804992"' "$SYMBOL_CSV_FILE"
O/P is
2nd
BAC,1,O,1,3586302804992
symbol/BAK file contents are
BAC,1,O,1,3586302804992o
Putting "" around $oid , on 3rd line, doesnt make any difference.
awkscript, you need to "pass" them with-v. For examplenum=3; awk -v n=$num 'BEGIN{print n}'.