0

A very basic question that I can't figure out the answer to: in my $HOME/.bashrc I'm setting up all sorts of stuff including the PATH environment variable, e.g. via:

export PATH="$PATH:$HOME/bin"

I have now noticed - and I'm not sure if this is only the case after a system upgrade (I'm on Arch) - that after commenting out every line in my .bashrc when I open another terminal emulator instance (e.g. xterm) PATH is still set up as if I had not modified my .bashrc at all. That seems very strange to me as it is definitely the only file on my system containing this particular PATH setup code. What's happening here?

5
  • Check the other dotfiles, like .profile aswell
    – Panki
    Commented Dec 18, 2020 at 12:10
  • Are you running bash, or zsh? Can you post the output of echo $SHELL?
    – GMaster
    Commented Dec 18, 2020 at 14:29
  • @Panki: I've checked ~/.bash_profile, /etc/profile and /etc/bash.bashrc. Weirdly enough aliases etc. from my .bashrc don' take effect in new bash instances, just the path seems to be cached somehow.
    – Peter
    Commented Dec 18, 2020 at 15:26
  • @GMaster: I'm using bash 5.1.0
    – Peter
    Commented Dec 18, 2020 at 15:27
  • Please edit your question and tell is if this is a local machine or if you logging in through ssh. Once logged in, what is the output of echo $-? And show us the output of grep -H PATH ~/.bashrc ~/.profile ~/.bash_profile ~/bash.login ~/.bash_aliases /etc/bash.bashrc /etc/profile /etc/profile.d/* /etc/environment 2> /dev/null.
    – terdon
    Commented Dec 18, 2020 at 17:33

0

You must log in to answer this question.

Browse other questions tagged .