~/.profile not being sourced upon login
#1
Bug 
Has anyone else had issues relating to ~/.profile not being sourced upon login.

I've made a couple of customisations that add a couple of directories to the system $PATH upon login. However, these don't seem to materialise when I login. Namely:

Code:
# set PATH so it includes the snap bin if it exists
if [ -d "/snap/bin" ]; then
PATH="$PATH:/snap/bin"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
   PATH="$HOME/.local/bin:$PATH"
fi


Both directories appear in the system $PATH if I run:


Code:
source ~/.profile

Ben
  Reply
#2
@Feakster, try this file instead;
Code:
.bash_profile
--
Arwen Evenstar
Princess of Rivendale
  Reply
#3
I've always referenced this flowchart to follow bash's initialization insanity:
https://i.stack.imgur.com/17NoJ.png

Pick your login type and follow the colored arrow to see which files bash loads under different circumstances.

See here for more: https://blog.flowblok.id.au/2013-02/shel...ripts.html
  Reply
#4
(11-09-2019, 02:10 PM)Arwen Wrote: @Feakster, try this file instead;
Code:
.bash_profile

Hi,

I thought it was the case that .bash_profile was sourced if it existed, otherwise .profile was sourced?

Just tried this and rebooted. The contents of the .bash_profile file were also not being sourced.

Ben

(11-09-2019, 09:40 PM)Arglebargle Wrote: I've always referenced this flowchart to follow bash's initialization insanity:
https://i.stack.imgur.com/17NoJ.png

Pick your login type and follow the colored arrow to see which files bash loads under different circumstances.

See here for more: https://blog.flowblok.id.au/2013-02/shel...ripts.html

Hi,

Thank you. I put the code in .bashrc & it works now.

Ben
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)