Until yesterday {13th of February) this has always worked (since i started using EOS), i.e. it has set my PATH variable for every terminal i started.
However, yesterday it just stopped working - PATH variable remained set to default.
I had no time to look yesterday …
Today i noticed that the ~/.profile file was not set to run as a program plus it and ~/.bashrc (and more) did not start with shabang - which i’d never noticed before so maybe …?
Has something changed in EOS to stop a terminal adding the .profile when it starts?
Or … ??
Any thoughts would be appreciated … even telling me where i should really be sticking my path change.
If memory serves, .profile isn’t run by bash when you open a terminal. It is executed when you login. I suspect it is/was being loaded by being called from somewhere else or because the terminal inherits those values from the environment.
I am not sure what has changed. I suppose it could be a lot of things.
Either way, if you want something in your terminal primarily, you should put them in ~/.bashrc. By default, ~/.bash_profile also loads ~/.bashrc so changes there should always be available in interactive shells.
bash --version
GNU bash, version 5.2.26(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"
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.
It says there that bash will read and execute commands from the first one that exists and is readable.
Could it be that ~/.bash_profile and ~/.bash_login didn’t exist before? That’s why the commands in .profile were executed—because ~/.profile was the only file that existed.
If either ~/.bash_profile or ~/.bash_login exists, ~/.profile will be ignored.
If the OP is indeed using LightDM, then yeah. I think this is relevant. This in fact explains the behavior described by the OP, at least in my view. Xsessions used to source .profile regardless of the shell in use. But now, it will only source ~/.profile if the shell in use is sh, ksh, etc.
Since the OP is using bash, only this code will be run:
In other words, it will fallback to the default bash behavior as mentioned here:
Since .bash_profile exists in the OP’s home directory, only .bash_profile would be sourced whereas .profile would be ignored, which didn’t use to be the case because before that change, the case statement didn’t exist.
# The code before the change
# Load profile
for file in "/etc/profile" "$HOME/.profile" "/etc/xprofile" "$HOME/.xprofile"; do
if [ -f "$file" ]; then
echo "Loading profile from $file";
. "$file"
fi
done