Getting the value of env variables

Hi,
I want to get the value of the env varables using the ksh script. All the env variables are stored in a file.
Eg.
file1

$INPATH
$OUTPATH

myscirpt:

for name in `awk { print $1 } file1`
do 
     cd $name
done

i'm getting the error like $INPATH not found.

in the same script if i use
cd $INPATH
it is working fine. Only problem i'm facing is reading from file and using.

Can anyone help me why i'm getting this error?
Thanks in advance...

You need to evaluate the "name" variable before you can use it that way,
essentially give the shell a chance to process it as though it was typed in.

eval cd $name

Depending on how much you are doing with name, it might be useful to do this first to avoid a lot of "eval"s.

eval name="$name"

As you are changing directory, be sure that you go back to a known place between "cd" commands
or it may not find the directory that you are looking for.

start=`pwd`
for name in `awk { print $1 } file1`
do
    eval name="$name"
    cd $start
    cd $name
done