LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I add a PATH that STICKS in Debian? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-add-a-path-that-sticks-in-debian-539048/)

lumix 03-20-2007 11:54 AM

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?

nx5000 03-20-2007 12:46 PM

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

lumix 03-20-2007 01:33 PM

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.

nx5000 03-20-2007 01:42 PM

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


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