Simple script to return environment variable

HI ,

In the below script I am trying to return the value of the environment variable TIBCO_HOME to the caller

#! /usr/bin/csh
set VAR_NAME=$1
echo VAR_NAME

On the aix console.. set to setenv TIBCO_HOME /app/tibco

When I execute the script... myscript.sh TIBCO_HOME, the script prints TIBCO_HOME. But I am expecting /app/tibco.

Can anyone help me to fix this?

Thanks,

Babu

#! /usr/bin/csh
set VAR_NAME=$1
echo $VAR_NAME

HI,
Thanks for your response.
I changed my script but still the script prints TIBCO_HOME.

I am invoking the script as "csh -f test1.sh TIBCO_HOME"

echo $TIBCO_HOME on unix console returns /app/tibco, I want the same output from my script.

Below is the modified script..

#! /usr/bin/csh
set VAR_NAME=$1
echo $VAR_NAME

Thanks,
bce

try to source the script

It is doing what its expected to do. You need to do this:

#! /usr/bin/csh
set VAR_NAME=$1
eval echo \$$VAR_NAME

Thanks u so much. I am getting the result.