Hi
I am running a script as root. The script uses su to ran some commands as another user in its environment. However I cannot seem to refer to the environment variables.
An example is shown below:
su - gri <<endgri
. moraenv HSGP apps # this sets the environment
echo $FSW_HOME # display the variable
env | grep FSW_HOME #
endgri
When the above is ran as root echo produces nothing, but the env command shows that FSW_HOME is set.
This is so puzzling. Does anyone know why i cannot access the environment variables when I su to another user?
Regards
Max
I am running a script as root. The script uses su to ran some commands as another user in its environment. However I cannot seem to refer to the environment variables.
An example is shown below:
su - gri <<endgri
. moraenv HSGP apps # this sets the environment
echo $FSW_HOME # display the variable
env | grep FSW_HOME #
endgri
When the above is ran as root echo produces nothing, but the env command shows that FSW_HOME is set.
This is so puzzling. Does anyone know why i cannot access the environment variables when I su to another user?
Regards
Max