Sure, but I was refering to the issues using single quotes in a nested awk. Back to your awk command, I see no issues using it as is. From the command line the output is correct:
cat temp.txt
mqsiaaa 123 888
mqsiddd 456 999
t2589gg 789 555
and
awk '$2~/456/ { printf $3 > "filefilter"}' temp.txt
#The expected output is correct:
cat filefilter
999
Same can be said if you use a variable:
var=`awk '$2~/456/ { printf $3 }' temp.txt`
echo $var
999