keeping my .bashrc active

I'm using Mountain Lion on one machine. I have an alias set up with .bashrc that is handy to use. I enable that .bashrc by doing "source .bashrc". It works. Um, for a while. Then it doesn't work, and I have to "source" it again. On other machines, once I "source" my .bashrc, it sticks. What am I doing wrong?

Mac mini, OS X 10.11

Posted on Aug 30, 2023 9:59 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 30, 2023 10:20 AM

In your ~/.bash_profile, use this line:


[[ -s ~/.bashrc ]] && source ~/.bashrc


Every time you launch the Terminal the contents of ~/.bashrc will be applied to the current Terminal session.


If you make changes to your ~/.bashrc in the current Terminal session then you can do either of:


source ~/.bashrc
source ~/.bash_profile


6 replies
Question marked as Top-ranking reply

Aug 30, 2023 10:20 AM in response to Dannymac22

In your ~/.bash_profile, use this line:


[[ -s ~/.bashrc ]] && source ~/.bashrc


Every time you launch the Terminal the contents of ~/.bashrc will be applied to the current Terminal session.


If you make changes to your ~/.bashrc in the current Terminal session then you can do either of:


source ~/.bashrc
source ~/.bash_profile


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

keeping my .bashrc active

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.