I have a guest
user account on my Debian system with XFCE desktop.
It has a ~/.profile
file added by default. The last few lines of this
file are:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
echo .profile executed
The last echo
command is added by me. I have ensured that $HOME/bin
exists.
guest@debian:~$ ls -ld $HOME/bin
drwxr-xr-x 2 guest guest 4096 Jan 9 09:42 /home/guest/bin
After booting my Debian system, I log into my XFCE desktop using the
guest
account and launch Terminal (xfce4-terminal). But I do not see
any evidence that ~/.profile
was executed.
guest@debian:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
man bash
makes it pretty clear that ~/.profile
is read and executed in an interactive login shell or a non-interactive shell with the --login
option. ~/.bashrc
is executed in interactive non-login shell, so it seems alright that when xfce4-terminal launches bash, ~/.profile
is not executed.
If ~/.profile
is not executed when we launch a new Terminal, why is
the PATH
updated in ~/.profile
?
Shouldn't Debian provide the PATH
update in ~/.bashrc
so that it is
available to the user when the user launches a terminal?
PATH
by adding$HOME/bin
to the beginning of thePATH
.