This question already has an answer here:
- Why doesn't .bashrc run automatically? 9 answers
I found a lot of people figuring out why instruction similar to this :
Put X to your ~/.bashrc and you can do Y
It always turns out that Mac OS X's bash's startup files (or Mac's Bash itself) doesn't source ~/.bashrc file, either in the login shell, or in a shell spawned from window system - like Terminal app in Mac OS X)
Why is this, when all other Unix-like systems with Bash I've worked with before have done this?
I found what Bash itself says about startup files (which could be helpful) :
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.