because first of all, $ doesn't work inside single quotes...
and second, if $ would work inside single quotes, you'd have some trouble getting the $ character in $2 and you'd be comparing $2 to the awk variable with name as specified by $awk ...
so:
wrong: awk '$2==$var' /path/to/file
(amounts to awk '$2==$0' /path/to/file)
wrong: awk "\$2==$var" /path/to/file
(if in shell var="abc", amounts to awk "$2==abc" /path/to/file
which is probably awk "$2==0" /path/to/file)
some solutions:
right: awk "\$2==\"$var\"" /path/to/file (use double quotes, escape special chars where needed)
right: awk '$2=="'$var'"' /path/to/file (use single quotes, but interrupt the single quoted string where needed)
right: awk -v var=$var '$2==var' /path/to/file (use -v to preload an awk variable)
HTH,
p5wizard