Moderators: ChriThor, LXF moderators
PATH=$PATH:$HOME/bin
PATH=$PATH:$HOME/bin:/usr/local/xds/bin
PATH="$PATH:/usr/local/xds/bin"
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
So .profile wouldn't be used unless it was sourced from .bash_profile. Stick with .bash_profile. Life was much simpler when we had just /etc/profile and ~/.profile, until Bash complicated it all with umpteen extra files.
cat ~/.profile
TEST="thisisatest"
echo x${TEST}x
xx
That depends on your desktop. It certainly doesn't apply with KDE. Something has to source ~/.profile and if bash doesn't you are relying on something else to do it. Even if your desktop does, you still wouldn't have the variable set in a console session.
eric@chaffinch:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
eric@chaffinch:~$
export PATH=$PATH:/usr/sbin
eric@chaffinch:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/sbin
eric@chaffinch:~$
grep profile ~/.bash*
martyn:~$ grep ZTEST .*profile
.bash_profile:export ZTEST2="set in .bash_profile"
.profile:export ZTEST1="set by .profile"
martyn:~$ grep "\.profile" .bash_profile
martyn:~$ set | grep ZTEST
ZTEST1='set by .profile'
ZTEST2='set in .bash_profile'
martyn:~$ grep "\.profile" /etc/X11/xinit/xinitrc-common
[ -r $HOME/.profile ] && . $HOME/.profile
Users browsing this forum: No registered users and 1 guest