My script builds a lot of these array lists, then compares their sizes which solves my problem, but runs very slow. 
set -A comboSorted -- $(
for x in ${IDs[*]}
do
nawk -v s=$x '
BEGIN { testPattern="^" s "$" }
{
if ( $2 ~ testPattern ) {
getline;getline;
if ($1 == "IMAGE_SIZE")
print s":"$2"-"$3
}
}' "tempFile" ;
done | sort -u
)
I can see the CPU isn't working hard, so maybe too many read/writes to the HDD? Can you guy suggest any improvements?
If you have sufficient ram, you could have nawk read the tempfile once, when it starts, store its lines in an array, and then read the IDs from standard input. For each ID you can then iterate through the tempfile array and check for matches. This way, you don't have to create a new nawk process for each loop iteration nor do you have to read the file in its entirety once for each $x (even if the file's contents are cache'd by the operating system, it still requires a syscall for each read).
Regards,
Alister