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
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