LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-13-2005, 10:45 PM   #1
lemuel
Member
 
Registered: Nov 2003
Location: Cebu, Philippines
Distribution: Ubuntu
Posts: 73

Rep: Reputation: 15
problems setting up PATH in ubuntu


hello

I'm having problems setting up my path in ubuntu

i edited the .bash_profile and put a PATH=$PATH:/opt/java
i expected the /opt/java would be in my PATH the next time i logged in, but to my disappointment, when I did an "env" it still wasn't included.

i also tried editing the /etc/profile and it also didn't work, even if I reset my pc.

but when I just do the setting up on the command line, it went well.

so i tested writing a simple test.sh which contains a "PATH=$PATH:/opt/java". when i executed it, it also didn't work. my path variable is still the same.

why is this?
 
Old 01-13-2005, 11:04 PM   #2
barryman_5000
Member
 
Registered: Jan 2005
Distribution: Gentoo/Vector/Debian
Posts: 95

Rep: Reputation: 15
try:

export PATH="$PATH:/opt/java"
 
Old 01-13-2005, 11:17 PM   #3
lemuel
Member
 
Registered: Nov 2003
Location: Cebu, Philippines
Distribution: Ubuntu
Posts: 73

Original Poster
Rep: Reputation: 15
thanks but it still doesn't work.

did an "env" and /opt/java still wasnt there. also did the test.sh.

could this be a bug in ubuntu?
 
Old 01-13-2005, 11:24 PM   #4
barryman_5000
Member
 
Registered: Jan 2005
Distribution: Gentoo/Vector/Debian
Posts: 95

Rep: Reputation: 15
You know you can do echo $PATH for the path too.

Are you using bash??
 
Old 01-14-2005, 02:05 AM   #5
lemuel
Member
 
Registered: Nov 2003
Location: Cebu, Philippines
Distribution: Ubuntu
Posts: 73

Original Poster
Rep: Reputation: 15
yes I'm using bash.

hm... I just tried it in Suse and it also wont work there, so I gues its not an ubuntu bug.

Hey thanks for the echo $PATH tip. thats so much easier.

ok i tried writing this simple shell test.sh

PATH=$PATH:/home
export PATH

then i executed it by inputting on the prompt - "sh test.sh"
then i did an "echo $PATH"

heres the output -
/home/lemuel/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin

there's no /home in the path
 
Old 01-14-2005, 10:26 AM   #6
barryman_5000
Member
 
Registered: Jan 2005
Distribution: Gentoo/Vector/Debian
Posts: 95

Rep: Reputation: 15
OH silly me . . . you forgot to put it in quotes!

export PATH="$PATH:/home"

that should do it.
 
Old 01-15-2005, 12:03 AM   #7
lemuel
Member
 
Registered: Nov 2003
Location: Cebu, Philippines
Distribution: Ubuntu
Posts: 73

Original Poster
Rep: Reputation: 15
still no good. but thanks anyway. i guess setting paths is just not for me
 
Old 01-15-2005, 12:51 AM   #8
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,156

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
Put some echo commands into .bash_profile to make sure it is run correctly. Also, remember that .bash_profile is only run on login shells. Nonlogin shells, like new xterms, do not run .bash_profile, but run .bashrc instead. I usually just have .bash_profile invoke .bashrc to get a consistent environment in login and nonlogin shells.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ubuntu] Problems setting Microsoft Intellimouse mouse and network pocetnik Linux - Software 0 11-25-2005 02:38 PM
Problems setting $PATH Lord Zoltar Slackware 2 02-08-2005 12:19 AM
setting PATH problems. CORE3 maddoggames Fedora 8 12-29-2004 03:57 PM
setting a path mjkramer Linux - Newbie 8 11-18-2004 08:35 PM
Setting the path Remco Linux - Software 2 10-13-2002 04:33 PM


All times are GMT -5. The time now is 02:23 AM.

Main Menu
Advertisement
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