.bashrc in Mac

Mac doesn’t read ~/.bashrc file when a shell starts. The order of files the shell read is  (reference:  http://hayne.net/MacDev/Notes/unixFAQ.html#shellStartup)

  1. /etc/profile
  2. ~/.bash_profile or ~/.bash_login or ~/.profile (only one of these files will be read, if it exists. If more than one file exist, it will only read the first existing one by the above order)

So one way to make Mac work with ~/.bashrc is to add the line

source ~/.bashrc

in ~/.bash_profile

Advertisements

About cgao

Cambridge, MA
This entry was posted in PC problem. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s