LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to set an environment variable? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-an-environment-variable-84444/)

dantemarmol 08-22-2003 02:20 AM

How to set an environment variable?
 
Pls. help, I just installed visualworks on Red hat. At the end got this instructions to set an environment variable name VISUALWORKS to the value: /usr/local/vw7 in the appropriate unix startup file.

PLS. TELL ME, HOW DO I DO THAT?
Thank you in advance.

exodist 08-22-2003 02:24 AM

well, you can add this to the /etc/rc.local file

export VISUALWORKS=/usr/local/vw7

and you can also type it in console, that should be what it is asking, there is a better fiel to add that to, but rc.local should work, and you don't risk screwing anything up.

leonscape 08-22-2003 02:24 AM

on a console type
export VISUALWORKS=/usr/local/vw7

To make it permanent:
ther should be a .bashrc file in your home directory. (The period at the beginning marks a hidden file).

add

export VISUALWORKS=/usr/local/vw7

and save.

exodist 08-22-2003 02:26 AM

lol, leonscape, we keep answering the same forums, and now we both sent the same general idea.. sweet deal.

leonscape 08-22-2003 02:28 AM

AND you keep beating me to it!!! :)

dantemarmol 08-22-2003 03:35 AM

Thanks so much to both of you for your quick reply.
But I am sorry, I am new to this kind of environment, I am still lost.. really sorry about that.. I typed: export VISUALWORKS=/usr/local/vw7 (and it was accepted). But I don't know how to save that.
Kindly tell me step-by-step; Thank you for bearing with me.

andrewlkho 08-22-2003 04:56 AM

Put it in /etc/rc.d/rc.local [or somewhere like that]....

Genesee 08-22-2003 10:59 AM

Hi dante -

I am not familiar with RedHat, but they are saying to open the file named 'rc.local' which is in directory /etc/rc.d, or the file '.bashrc' which is in your home directory, add the line as you typed it in the console, and save the file. I don't know which file is the preferable location in RH.

you can use any text editor to do that - maybe kedit, or whatever RH installs - look in the menu under "text editors" or some similar title. you can always use vi, but it can be a bit confusing at first.

to get a listing of your current environment variables, try typing 'env' in a console.

:cool:


All times are GMT -5. The time now is 02:46 PM.