ksh variable pass to awk

I'm trying to store the response from a nawk command inside of a ksh script. The command is:
text=$(nawk -F: '$1 ~ /${imgArray[$i]}/ {print $2}' ${etcDir}/captions.txt)

From what I can tell, the imgArray variable is not being expanding when it is inside the single quote ('). Is there something I need to do to escape this to make it work?

Try putting a "'" on either side of any variables in a nawk or awk command like this:

text=$(nawk -F: '$1 ~ /'${imgArray[$i]}'/ {print $2}' ${etcDir}/captions.txt)
text=$(nawk -F: '$1 ~ /'"${imgArray[$i]}"'/ {print $2}' ${etcDir}/captions.txt)

Note the double quotes around the variable; they are needed in case there is whitespace inside its value.

A more normal method is:

text=$(nawk -F: -v var="${imgArray[$i]}" 'index($1,var) {print $2}' ${etcDir}/captions.txt)

I think that you need to use the execution "quotation marks", for example:

e=`awk -F: '{ print $1 }' test.txt`

The second one from cfajohnson worked prefect. Thanks everyone for their help.