LinuxQuestions.org
Visit Jeremy's Blog.
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-20-2007, 11:54 AM   #1
lumix
Member
 
Registered: Mar 2007
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323

Rep: Reputation: 30
How do I add a PATH that STICKS in Debian?


I've already got in my /etc/profile:

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then
PATH="/usr/java/jdk1.5.0_11/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/java/jdk1.5.0_11/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"

fi

if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi

export PATH

umask 022

JAVA_HOME=/usr/java/jdk1.5.0_11/
export JAVA_HOME


But the JAVA vars don't appear in "env". Why?
 
Old 03-20-2007, 12:46 PM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
It doesn't appear in which case?

If you open an xterm AS USER, it works. You're not supposed to work as root anyway.

man bash part INVOCATION
 
Old 03-20-2007, 01:33 PM   #3
lumix
Member
 
Registered: Mar 2007
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323

Original Poster
Rep: Reputation: 30
who said anything about working as root?

If I said or implied it, I didn't intend to. If I open "konsole" or "kate", as myself, and type "env" at the command prompt I get a path without the java directory.
 
Old 03-20-2007, 01:42 PM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Quote:
Originally Posted by lumix
If I said or implied it, I didn't intend to.
For the root stuff, it's only a bad habit that is good to not take. And using root in general doesn't help.

Quote:
If I open "konsole" or "kate", as myself, and type "env" at the command prompt I get a path without the java directory.
Okay
Profile file is read WHEN you logging only, it is not executed again.
So I guess you just made the change and you need to restart your WM.

If you don't want to restart your WM, you have to execute profile in the current shell:
source /etc/profile

Again, my best advice would really be that you read
man bash , Part invocation
also
search for "source" in the manpage

Using man and searching:

man bash
type /
type what you look for, example INVOCATION
type enter
type n for next occurence
type ? to invert direction of searching and then n for going up
type / again to go forward again
type q to quit
 
  


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
how to: add to $PATH?? (SUSE) epsilon72 Linux - Software 10 03-15-2007 10:10 PM
Do you add to the path line or make a new path in /etc/profile? M$ISBS Linux - Newbie 2 12-13-2006 02:14 PM
add to path towel401 Linux - Newbie 3 07-23-2006 10:38 PM
Add path to @INC deus1 Linux - Software 0 07-27-2005 07:52 AM
How do I add something to my $PATH? iammeuno Linux - Software 1 12-18-2003 04:02 PM


All times are GMT -5. The time now is 07:11 PM.

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