You need to use AWK's special way of passing variables into it:
Code:
echo "Enter month: "
read MONTH
awk -v mon="$MONTH" '$3~mon { print $1, $2, $3, $4, $5, $6}' *.hits
Or equally:
Code:
awk '$3~mon { print $1, $2, $3, $4, $5, $6}' mon="$MONTH" *.hits
Same thing if year is also needed:
Code:
awk -v mon="$MONTH" -v year="$YEAR" '$3~mon && $6~year { print ... } *.hits