I also just came along the issue that I wanted to append the PATH and PYTHONPATH environment variables and tried to use .profile
for it because this is usually recommended as the best place for shell independent stuff. On most other Linux systems it seems to be sources by all shell types including basic sh
and bash
.
But in Solus Linus the .profile
is not sources for a GUI terminal session with bash as already mentioned in this thread.
What is also strange in my view is that the default ~/.bashrc
and ~/.profile
first source the system wide profile
from /usr/share/defaults/etc/profile
. In other systems this is not required as the system wide profile is always sourced before the local use .profile
and/or .bashrc
are executed.
One idea to make the behaviour more similar to other systems could be to source ~/.profile
from ~/.bashrc
instead of the system wide profile (which will still be sourced then via ~/.profile
). In this way, the bash shell would essentially source the system profile, local .profile and finally the rest of .bashrc in correct sequence.
I found some interesting comments about compatibility with other shells than bash
in this StackExchange post.
.bashrc
if [ -f "$HOME/.profile" ]; then
source "$HOME/.profile"
else
source /usr/share/defaults/etc/profile
fi
# ... remaining .bashrc
.profile
source /usr/share/defaults/etc/profile
# for example add something to the PATH
PATH=$HOME/.local/bin:$PATH; export PATH
# ... remaining .profile