LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   SUSE Environment Vars (https://www.linuxquestions.org/questions/suse-opensuse-60/suse-environment-vars-253946/)

apocolpse 11-12-2004 04:46 AM

SUSE Environment Vars
 
I use SUSE 9.1 HOw do I set env variables in suse ? is there a special management tool for this operation ? (newbie)

jtakacs 11-12-2004 07:18 AM

Hi,

First I am assuming that you have created a user for yourself. In my example I shall use julius as the user. Do not use root unless you only want it for the root user.

Open a terminal and cd /home/julius (if you installed Linux correctly there should be a subdirectory in your /home directory with your user name) . I am assuming that you went the default bash shell. The prompt sould be a pound sign #. Using one of the many editors provided with linux open the .profile file. The dot (or period before the file name means that it is a hidden file. If you want to see all the hidden files tepe ls -al from your terminal prompt and you will see a bunch of them).

add your enviromental variables as in this example:

export ORACLE_HOME=/uo1/app/oracle
export PATH=$PATH/$ORACLE_HOME

This first creates an enviromental variable called ORACLE_HOME then it appends this to the PATH variable. This is just an example you may or may not want to do exactly this.

Save the file and exit. From the desktop interface (KDE, GNOME, or whichever one of the many desktops you may be using, I prefer KDE) log off and log back on.

to test to see if it is correct open a terminal just as before and type:
echo $ORACLE_HOME
youe should get /u01/app/oracle (my example)

good luck

apocolpse 11-12-2004 09:24 AM

Thanks. but this does not set the variables for all the users on th system. How can I do that ?

abisko00 11-12-2004 10:09 AM

There is a /etc/profile and /etc/profile.local for this purpose. SuSE recommends to put your own stuff in /etc/profile.local, since /etc/profile will be overwritten during updates.

apocolpse 11-12-2004 11:26 AM

Its not there. do I have to create it ?and when I do, I just save it to the /etc dir ?

abisko00 11-12-2004 11:31 AM

Simply create one yourself and save it to /etc (be root)!

EDIT: changes may not be recognized before reboot. If you would like to use it without rebooting, type 'source /etc/profile.local' at command line.

linuQx 11-18-2010 03:04 PM

thankyou
 
my /etc/profile.local :

PATH=$PATH:/path/to/wherever
export PATH


All times are GMT -5. The time now is 08:52 PM.