LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   create new environment variable (https://www.linuxquestions.org/questions/linux-newbie-8/create-new-environment-variable-443087/)

ctlqt12 05-09-2006 07:49 AM

create new environment variable
 
how to create new environment variable??
Example : when I type "env", i will see list of variables like HOME,TERM .... . So i want to set a new variable Dir="/root/Question"
And Dir variable will be display when i type "env"

Agrouf 05-09-2006 08:25 AM

export Dir="/root/Question"

ctlqt12 05-09-2006 10:21 PM

Thanks. But after i restart computer, I type "env", DIR is not displayed. How do i solve it?

nadroj 05-09-2006 11:28 PM

you could add the command to your ~/.bash_profile file.. or create one and add it if it doesnt exist.

fotoguy 05-10-2006 02:56 AM

Or add it to the /etc/rc.d/rc.local file and it will be loaded everytime you start

ioerror 05-10-2006 04:26 AM

Quote:

Or add it to the /etc/rc.d/rc.local file and it will be loaded everytime you start
Er, no it won't. /etc/rc.d/rc.local is a boot script, it has nothing to do with a user's shell environment.


All times are GMT -5. The time now is 11:36 AM.