LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   adding $PATH variables (https://www.linuxquestions.org/questions/linux-newbie-8/adding-%24path-variables-154556/)

karupt 03-07-2004 09:40 AM

adding $PATH variables
 
hi.. how do i add a path variable? my programs arent finding my java vm, but whenever i add a path, i lose all my other paths and my commands too. so when i echo $PATH all that comes up is the one i added with the export command and thats it, and bash commands dont work anymore.

jtshaw 03-07-2004 09:43 AM

export PATH=$PATH:newstuff

KDE4me 03-07-2004 09:46 AM

this has been covered extensively before in this thread...
put in your .bash_profile
export PATH=$PATH:/usr/local/java/jdsdkX.X.X/bin/
if you want to test in your session:
. ~/.bash_profile #source the config

otherwise close all your consoles and the path will now be present in them.

karupt 03-07-2004 10:06 AM

yes but i dont have a .bash_profile in SuSE, under /ect/.profile it says not to alter that file... do i need to create a .bash_profile?

slakmagik 03-07-2004 11:36 AM

You can edit anything you want - but I guess with SuSE, if you break it, you get to keep the pieces. So, sure, create a user-specific file. That's what you should really do as a matter of course unless you specifically wish to alter system-wide defaults.

KDE4me 03-07-2004 06:27 PM

Well that all depends on what shell you use as to whether you have a .bash_profile, I believe if you edit/create a ~/.profile that is the bourne(sh) default file so it should work for all bourne shells if they don't have their own specific profile. I hope you realize that you need to scan your home dir with ls -a to see the hidden files. From the sounds of it you probably have a ~/.profile instead of a .bash_profile you should have a ~./bashrc and a ~/.bash_history also. Anyway if you don't you can probably copy any files from /etc/skel and if all else fails read the manual for bash and consult the "files" section.


All times are GMT -5. The time now is 10:48 PM.