Skip to content

Instantly share code, notes, and snippets.

@todgru
Created November 19, 2012 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todgru/4114034 to your computer and use it in GitHub Desktop.
Save todgru/4114034 to your computer and use it in GitHub Desktop.
BASH OSX notes bash osx

Order of execution in OSX:

/etc/profile
~/.bash_profile
~/.bashrc
~/.bash_login
~/.profile
~/.bash_logout

For rvm to be happy, the order of PATH in .bashrc is important in OSX. The original way the PATH is set looks like: PATH=$PATH:$HOME/.rvm/bin. No, no. The PATH should be: PATH=$HOME/.rvm/bin:$PATH Note the trailing $PATH instead of leading.

Put aliases, source and custom prompt info in .bashrc.

From man bash:

When  bash  is invoked as an interactive login shell, or as a non-interactive shell with 
the --login option, it first reads and executes commands from the file /etc/profile, if 
that file exists.  After reading that file, it looks for ~/.bash_profile, ~/.bash_login, 
and ~/.profile, in that order,  and reads  and  executes commands from the first one 
that exists and is readable.  The --noprofile option may be used when the shell is started 
to inhibit this behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment