LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-07-2004, 09:40 AM   #1
karupt
Member
 
Registered: Mar 2004
Distribution: Mandrake 10
Posts: 59

Rep: Reputation: 15
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.
 
Old 03-07-2004, 09:43 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
export PATH=$PATH:newstuff
 
Old 03-07-2004, 09:46 AM   #3
KDE4me
Member
 
Registered: Apr 2003
Location: Australia
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90

Rep: Reputation: 15
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.
 
Old 03-07-2004, 10:06 AM   #4
karupt
Member
 
Registered: Mar 2004
Distribution: Mandrake 10
Posts: 59

Original Poster
Rep: Reputation: 15
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?
 
Old 03-07-2004, 11:36 AM   #5
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
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.
 
Old 03-07-2004, 06:27 PM   #6
KDE4me
Member
 
Registered: Apr 2003
Location: Australia
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90

Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extra path variables? mjm461 Linux - General 1 09-15-2005 02:21 PM
Setting PATH and other variables durrantj Ubuntu 2 08-25-2005 07:44 PM
can save new $PATH variables slinkysteve Linux - Newbie 1 10-29-2003 10:30 AM
removing path variables globally Nevetsmik103081 Linux - General 1 07-05-2003 01:17 PM
rh7.1 environment variables (eg path) dave_lane Linux - Newbie 1 09-20-2001 08:05 AM


All times are GMT -5. The time now is 03:18 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration