LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to set environment variable with a given script (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-environment-variable-with-a-given-script-770909/)

sonu kumar 11-23-2009 01:12 AM

how to set environment variable with a given script
 
hi dear all,

i have to set environment variables , after the installation of intel(R)MKL for linux OS given in intel mkl user guide, which are INCLUDE, LD_LIBRARY_PATH, MANPATH, LIBRARY_PATH, CPATH, FPATH, NLSPATH using the script file which, in my case, is "mklvarsem64t.sh"

How can i set these environment variables?

Do i need to set all these variables?

Can anybody help me?

With Regards

Sonu

David the H. 11-23-2009 04:31 AM

Variables set inside a script are only available inside that script, or more precisely, within the subshell running the script. It would be a security hole otherwise. So it's impossible to set an environment variable that will affect the system as a whole that way.

You have to set these variables with one of your startup scripts instead, if you want them to be available globally.

Kilam orez 11-23-2009 04:52 AM

to set environment variables permanently use the .bashrc file in your home directory.


All times are GMT -5. The time now is 08:21 AM.