LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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
 
Thread Tools
Old 03-07-2004, 10:40 AM   #1
karupt
Member
 
Registered: Mar 2004
Distribution: Mandrake 10
Posts: 59
Thanked: 0
adding $PATH variables


[Log in to get rid of this advertisement]
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.
karupt is offline     Reply With Quote
Old 03-07-2004, 10:43 AM   #2
jtshaw
Moderator
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu 9.10 AMD64, RHEL3/5
Posts: 3,890
Blog Entries: 1
Thanked: 3
export PATH=$PATH:newstuff
jtshaw is offline     Reply With Quote
Old 03-07-2004, 10: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
Thanked: 0
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.
KDE4me is offline     Reply With Quote
Old 03-07-2004, 11:06 AM   #4
karupt
Member
 
Registered: Mar 2004
Distribution: Mandrake 10
Posts: 59
Thanked: 0

Original Poster
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?
karupt is offline     Reply With Quote
Old 03-07-2004, 12:36 PM   #5
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware 13.0, -current
Posts: 3,887
Blog Entries: 1
Thanked: 27
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.
slakmagik is offline     Reply With Quote
Old 03-07-2004, 07: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
Thanked: 0
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.
KDE4me is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 03:21 PM
Setting PATH and other variables durrantj Ubuntu 2 08-25-2005 08:44 PM
can save new $PATH variables slinkysteve Linux - Newbie 1 10-29-2003 11:30 AM
removing path variables globally Nevetsmik103081 Linux - General 1 07-05-2003 02:17 PM
rh7.1 environment variables (eg path) dave_lane Linux - Newbie 1 09-20-2001 09:05 AM


All times are GMT -5. The time now is 02:21 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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration