Parallel increment of nested for loop

Hi,

I am using solaris 5.10 environment and need help on doing parallel increment of nested for loop.

Samples

#inside the code the values assigned to a variable by another awk command will be like
a=/xyz/pg/as
/xyz/pg/as2
/xyz/pg/as3
b=/xyz/sd/fd1
/xyz/sd/fd2
/xyz/sd/fd3

for q in ${a[@]}; do
  for p in ${b[@]}; do
  LName=`find "$p" -name *"$x".txt -type f |sort | head -1`
  if [ "$LName" != "" ]; then		
     break
  fi
  done
  done

definitely there will be equal amount of records in both variable a & b. based on the file availability in the corresponding path in variable b, i need to choose the corresponding path from variable a.

say for example *"$x".txt file was available in the path /xyz/sd/fd3 (3rd iteration) i need to choose the corresponding path (/xyz/pg/as3) from variable a for further processing.

cFile=`find "$q" -name *.log -type f |sort | head -1`

Unfortunately, you don't mention the shell version that you use. A recent one would help... This one is for bash 3+ ...
You assign data to simple variables a and b , but reference either as an array. Why not use arrays in the first place?

a=(/xyz/pg/as
/xyz/pg/as2
/xyz/pg/as3)
b=(/xyz/sd/fd1
/xyz/sd/fd2
/xyz/sd/fd3)
for i in ${!a[@]}; do echo ${a[$i]}, ${b[$i]}; done
/xyz/pg/as, /xyz/sd/fd1
/xyz/pg/as2, /xyz/sd/fd2
/xyz/pg/as3, /xyz/sd/fd3