Problem combining two variables into one

Hello,
I have a problem combining two variables into one.

I did the following:

in my env variables i had set

PATH_DESTINATION_1=/root/path_one
PATH_DESTINATION_2=/root/path_two

#!/usr/bin/ksh

count=1
count_path=2

while [ $count -le $count_path ]
do

DESTINATION_PATH=${PATH_DESTINATION_$count}

echo "DESTINATION PATH IS: $DESTINATION_PATH"

done

I expect so this result:

DESTINATION PATH IS: /root/path_one

DESTINATION PATH IS: /root/path_two

But i got this error :

DESTINATION_PATH=${PATH_DESTINATION_$count}: bad substitution

Do you have any idea how to make it work.
Thanks

Use eval, try:

eval "DESTINATION_PATH=\$PATH_DESTINATION_${count}"

instead of:

DESTINATION_PATH=${PATH_DESTINATION_$count}

It works! Thanks!

array[1]=/root/path_one
array[2]=/root/path_two
count=1
count_path=2
while [ $count -le $count_path ]
do

DESTINATION_PATH=${array[$count]}

echo "DESTINATION PATH IS: $DESTINATION_PATH"

done