.profile file I have the line:
# source bashrc if it exists if [ -f ~/.bashrc ]; then source ~/.bashrc fi
to make sure that my
.bashrc file is sourced if it exists. I also have a set up script that I run on new machines to set up my environment that is for some reason behaving differently.
At the end of the setup script I have:
# read .profile source "$USERDIR/.profile"
$USERDIR points to my home directory. I know that
.profile is properly sourced when this script executes because I echo ".profile sourced", and this is printed when the script finishes.
.bashrc is not read from
.profile is sourced from this setup file). I can't figure out why because just typing
source .profile from
bash works as it should.
.bashrc is not run because the echo line in my rc file echoes only when I source
.profile directly and not from this set up script. The
.bashrc script does exist when I try to source it (so the
if [ -f ~/.bashrc ] should execute) because it is created at the same time .profile is.