Is there a way to make my .bash_profile load the contents of my .profile file?

3

1

I was using a .profile quite happily for two years on my Mac now running Yosemite.

A recent brew install created a .bash_profile and whilst my .profile still exists, it is now no longer loaded.

I could copy and paste everything across, but I'd like to make the minimum number of changes required to solve this problem. I'd like to point the .profile file to load the .bash_profile file. I'd like to know how.

My question is: Is there a way to make my .bash_profile load the contents of my .profile file?

hawkeye

Posted 2015-07-18T06:17:41.887

Reputation: 407

2In .bash_profile, add the line source ~/.profile. – John1024 – 2015-07-18T06:21:46.950

@Larssend Sometimes, a comment with such a simple & short answer elicits a clarification from the OP regarding other requirements that he has but didn't mention. – John1024 – 2015-07-18T23:18:44.343

Answers

3

I found this, it's a pretty good article and I think it may be of some use:

https://blog.dghubble.io/post/.bashprofile-.profile-and-.bashrc-conventions/

leeghwrd

Posted 2015-07-18T06:17:41.887

Reputation: 46

Hello. Your link contains the answer, but it is customary to leave a complete answer in the answer itself so that any that comes to superuser at a later time can see the answer directly from the site. This in case the link you provided dies and your answer is left useless. Cheers. – Mogget – 2015-07-20T05:07:24.133

@Mogget, understood! Thanks for positive feedback. – leeghwrd – 2018-03-21T15:57:58.430

3

This is the change I made to my .bash_profile file to make this work:

source ~/.profile

hawkeye

Posted 2015-07-18T06:17:41.887

Reputation: 407

2You don't need to source it (you can use . instead). Even better is if [ -r ~/.profile ]; then . ~/.profile; fi where the -r tests if ~/.profile is reabable. – DavidPostill – 2015-07-18T14:26:24.863