Shell variables substitution in a file

Hi,

I have to read a file and translate the contents including substituting the variables if any and write to another file without using sed or awk.
For ex:-
inputfile.txt
-----------
servername=$SERVER
application=$APPL
outputfile.txt
------------
servername=actual server name
application=actual application name

i tried with :
while read line
do
echo $line
done < inputfile.txt > outputfile.txt
BUT it's not expanding the shell variables.
Appreciated for your help...

Try:

eval echo $line

excellent... It's working fine.

Thanks Scrutinizer