4 ms·
Bash_profile vs. .bashrc
- RexRollman 12y agoIn the example he gives, like many I have seen on the Internet, it tests for .bashrc and if it exists, sources it. But if you didn't test it and for some reason .bashrc didn't exist, what would happen? And if nothing bad would happen, why test for it?
- akandiah 12y agoIt's just for cleanliness. The script would error out with something along the lines of "No such file or directory".
- RexRollman 12y agoThanks. I've never tried it out and was curious if anyone knew.
- blippe 12y agoI would recommend reading[0] instead. [0] http://www.thegeekstuff.com/2008/10/execution-sequence-for-bash_profile-bashrc-bash_login-profile-and-bash_logout/ http://www.thegeekstuff.com/2008/10/execution-sequence-for-b...
- blippe 12y agoAnd quite honestly the man page of bash is quite readable, under invocation. http://linux.die.net/man/1/bash http://linux.die.net/man/1/bash
- Canada 12y agoIn my opinion the only thing .bash_profile should do is source .bashrc, that way the environment is consistent regardless of invocation.