I want to install rvm on my Snow Leopard machine.
It says I need to add a line to my .bashrc
file (I'm using bash) but where is my .bashrc
file?
.bash-profilebashosx lionosx-snow-leopardterminal
I want to install rvm on my Snow Leopard machine.
It says I need to add a line to my .bashrc
file (I'm using bash) but where is my .bashrc
file?
Best Answer
Regarding the problem with
.bashrc
above:On most systems,
~/.bashrc
is only used when starting an interactive non-login shell. However, when you start up a new shell it is often an interactive login shell. Since this is a login shell, the.bashrc
is ignored. To keep the environment consistent between non-login and login shells, you must source the.bashrc
from your.profile
or your.bash_profile
.See the Bash Reference Manual, section 6.2 Bash Startup Files
On my Mac (Running Leopard), there was no line to source
~/.bashrc
. I had to add this functionality on my own.On some systems and other OSes,
.bashrc
is sourced from the global/etc/profile
or/etc/bash_profile
, or is done using the template files from/etc/skel
.To be honest the distinction between
.bashrc
and.bash_profile
is not well understood by the community. When many developers say "Add this to your .bashrc", what they really mean is "Add this to your .bash_profile". They want the functionality to be added to your login shell (which is.bash_profile
), not to your non-login shell. In reality, it doesn't usually matter and placing configuration in.bashrc
is acceptable.