Bash configuration on Mac OS X 10.4+

When configuring the bash on OSX via ~/.profile it seems to completely ignore it as soon as ~/.bash_profile exists. If this is correct and expected behavior, should I add my extra configuration stuff to ~/.bash_profile as well or use it instead of ~/.profile?

Thanks in advance.

Answers


It's expected behaviour. See here

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.

So only the first readable one counts.

As for which you should use, it's up to you - unless there are corporate policies or something else that creates a specific one, or relies on a specific one existing.


Need Your Help

Order list with objects based on attributes data in Java

java sorting enums

I need to order my List with 'Foo' objects based on a Enum value that Foo has as an attribute. I found 'Comparators', and I have used them before. But I always had some integer / double attribute, ...

cloning div according to number selected in jquery

jquery select clone

I need some serious help! I am trying to create a hotel search engine. I need to get the number of rooms from a select box and clone a div of select boxes the same number of times as selected in the

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.