A short answer is,
.bash_profile is executed to configure your shell when you login (type username and password) via console, locally or remotely. Just like each time when you ssh to your cluster/server, it will automatically call .bash_profile.
.bashrc is executed when you start a new bash instance, either by opening a new terminal window or start a new bash script. So, say in Mac, when you type Command+T to open a new tab, it will call .bashrc.
Josh recommend to solve the confusion by calling .bashrc in .bash_profile, such as
if [ -f ~/.bashrc ]; then source ~/.bashrc fi
No comments:
Post a Comment