Suppose I have a file input.txt with few columns and few rows, the first column is the key, and a directory dir with files which contain some of these
input.txt
dir
In case you still want to use grep inside awk, make sure $1, $2 etc are outside quote. eg. this works perfectly
cat file_having_query | awk '{system("grep " $1 " file_to_be_greped")}'
// notice the space after grep and before file name