So, I thought I’d finally document the outcome of my experiment here for posterity:
bash_profile: interactive login shells
bashrc: non-interactive login shells
profile: I’m guessing this is used when you do not have a bash_profile file. I found it hard to find a definitive answer, though.
$ cat .bashrc
export BASHRC=’loaded’
$ cat .bash_profile
export BASH_PROFILE=’loaded’
$ cat .profile
export PROFILE=’loaded’
$ echo $BASHRC
$ echo $BASH_PROFILE
loaded
$ echo $PROFILE
Removing my .bash_profile file gives the following results:
$ echo $BASHRC
$ echo $BASH_PROFILE
$ echo $PROFILE
loaded
So, it looks like the .profile is loaded when no .bash_profile exists, but that the .bash_profile supercedes .profile when it is found, preventing it from being loaded.
bash_profile: interactive login shells
bashrc: non-interactive login shells
profile: I’m guessing this is used when you do not have a bash_profile file. I found it hard to find a definitive answer, though.
$ cat .bashrc
export BASHRC=’loaded’
$ cat .bash_profile
export BASH_PROFILE=’loaded’
$ cat .profile
export PROFILE=’loaded’
$ echo $BASHRC
$ echo $BASH_PROFILE
loaded
$ echo $PROFILE
Removing my .bash_profile file gives the following results:
$ echo $BASHRC
$ echo $BASH_PROFILE
$ echo $PROFILE
loaded
So, it looks like the .profile is loaded when no .bash_profile exists, but that the .bash_profile supercedes .profile when it is found, preventing it from being loaded.