find and replace issue using awk

Hi All,
point 1. I have n number of environment variable files in different folders. All file names are ending with one thing common ie, *envset.sh
point 2. All these contains Varilables and some other information like following

*envset.sh ===>>

CORE_DB2_ROOT_JAVA=${CORE_DB2_ROOT_JAVA}
# Add quotes around the name in case there are spaces in the name.
CORE_DB2_ROOT_JAVA="$CORE_DB2_ROOT_JAVA"
echo CORE_DB2_ROOT_JAVA [$CORE_DB2_ROOT_JAVA]
CORE_WAS_HOME=${CORE_WAS_HOME}
# Add quotes around the name in case there are spaces in the name.
CORE_WAS_HOME="$CORE_WAS_HOME"
echo CORE_WAS_HOME="$CORE_WAS_HOME"
DB_USER_NAME=${DB_USER_NAME}
DB_USER_NAME="$DB_USER_NAME"

point 3 I have one file named tokenvalues.txt which contains the variable name and values to that variables.

tokenvalues.txt

CORE_DB2_ROOT_JAVA=/java/bin
CORE_WAS_HOME=/home/was/path
DB_USER_NAME=db2admin.

Point 4: Now using this tokenvalues.txt as a input file i am going to replace all the variables in *envset.sh that are matching the string ${varname}

following is the code file (tokenreplace.sh) that is written
tokenreplace.sh >>

for file in `find . -name "*env.sh" -print` 
do
awk -F= 'NR==FNR {_[$1]=$2; next} _[$1] {print $1,_[$1];next}1' OFS="=" tokenvalues.txt $file > tmp; mv tmp $file; 
echo $file
done

point 5 : but this is replacing all the instances wherever it is matching variable name from input file. where as i jst want to replace those where
varname={varname} is matching.

Any help on this will be strongly appreciated.

Thanks in advance

Nitin

You can make your specification much easier if display the desired output.

Desired output would be :

CORE_DB2_ROOT_JAVA=/java/bin
# Add quotes around the name in case there are spaces in the name.
CORE_DB2_ROOT_JAVA="$CORE_DB2_ROOT_JAVA"
echo CORE_DB2_ROOT_JAVA [$CORE_DB2_ROOT_JAVA]
CORE_WAS_HOME==/home/was/path
# Add quotes around the name in case there are spaces in the name.
CORE_WAS_HOME="$CORE_WAS_HOME"
echo CORE_WAS_HOME="$CORE_WAS_HOME"
DB_USER_NAME=db2admin.
DB_USER_NAME="$DB_USER_NAME"

This will do the trick:

#!/usr/bin/ksh
rm -f Token_sed
IFS='='
while read mField mValue
do
  mOld=${mField}'=${'${mField}'}'
  mNew=${mField}'='${mValue}
  echo "s@${mOld}@${mNew}@" >> Token_sed
done < Token_File
sed -f Token_sed Input_File