I am using iTerm in Mac OS X 10.6. It seems when I open iTerm, neither .bashrc
nor .bash_profile
is sourced. I can tell because the aliases defined in .bashrc
are not set. How to fix?
macOS iTerm – .bashrc Not Sourced
bashmac
bashmac
I am using iTerm in Mac OS X 10.6. It seems when I open iTerm, neither .bashrc
nor .bash_profile
is sourced. I can tell because the aliases defined in .bashrc
are not set. How to fix?
Best Answer
Bash will source EITHER .bash_profile or .bashrc, depending upon how it is called. If it is a login shell, Bash looks for ~/.bash_profile, ~/.bash_login, or ~/.profile, in that order, and sources the first one it finds (and only that one). If it is not a login shell but is interactive (like most terminal sessions), Bash will source ~/.bashrc.
Likely, iTerm is looking for ~/.bashrc. If it's configured to start as a login shell, it will look for ~/.bash_profile. It's almost certainly an error within the config file rather than that the shell is not sourcing it.
I would put a line at the beginning of each file. At the top of ~/.bash_profile:
And at the top of ~/.bashrc:
Then, open a new iTerm and type
That should confirm the file is being sourced and you can look into the syntax of the file.