Multiple variable substitutions

Is there anyway to accomplish this?
(ksh)

FILES_TO_PROCESS='NAME1 NAME2'

SOURCE_NAME1=/tmp/myfile
TARGET_NAME1=/somewhere/else
# other file names

for i in $FILES_TO_PROCESS
do
file1=SOURCE_$i
file2=TARGET_$i
echo cp ${$file1} ${$file2}  <-- how do get this to work.
done

Is it what you are trying to achieve ?

SRC=/tmp/src
DEST=/tmp/dest
for i in file1 file2
do
echo "cp $SRC/$i $DEST/$i"
done

or

... 
eval file1=\$SOURCE_$i
eval file2=\$TARGET_$i
...
eval echo "cp $file1 $file2"

eval will force the expansion of $var but not the one which is \ protected
so the finale commande after eval should look like
echo "cp $SOURCE_NAME1 $TARGET_NAME1"

Note that this would suppose that you have already setup the 2 other variables

SOURCE_NAME2=/whateverdir/whaterfile
TARGET_NAME2=/whatevernewdir/whatevernewfile

... which does not currently appear in your code

You could just copy dir

cp -p /sourcedir/* /targetdir

If you want to move them and rename them at the same time, please give us some clue about how you want them to be renamed

Note the trailing slash to ensure it is a dir.

(
cd /tmp/src
cp NAME1 NAME2 /tmp/dest/
)