Skip to main content
3 of 3
Commonmark migration

This morning I moved a bunch of personal information out of my bash_profile and bashrc and added them to a new file I call privaterc.

In my privaterc file I set this variable:

PRIVATERC_RUN=yes 

Now in my bash_profile I have added this line:

[[ $PRIVATERC_RUN != yes && -f ~/.privaterc ]] && source ~/.privaterc

This will cause privaterc to only be sourced if it hasn't previously been sourced in this shell.


Also as for the profile weirdness you are seeing, the article I linked in the comment states the following about mac:

Mac OS X — an exception

An exception to the terminal window guidelines is Mac OS X’s Terminal.app, which runs a login shell by default for each new terminal window, calling .bash_profile instead of .bashrc. Other GUI terminal emulators may do the same, but most tend not to.

jesse_b
  • 41.6k
  • 14
  • 108
  • 162