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?