Source Env file in the Shell Script

Hi

I am having a script which sets the application environment. In this script i am sourcing the applications env file, when i am debugging the script i see its executing all the environment values and all the variable values are set properply.

Once this main shell script executes, then all the env variables are set to blank.

How to set the values this values till i logout of the session

I have source the env file as . script.env. it is executing, but the variables are set after the script comes out..

Could anyone please provide any inputs on this

(Assuming that script.env can be found in the current PATH with . script.env).
Sounds like the script.env needs export statements for each environment variable.

MY_VARIABLE="my_value" ; export MY_VARIABLE
Or in some shells just:
export MY_VARIABLE="my_value"

An example would help.

Hi,

env file has all export statement. The value is also exported in the script. But values are not set after the script execution

umakanth

Needs an example showing what is in each script (assuming there are two scripts) and how they are executed.