Which Bash config to run depends on two conditions -- Interactive vs. Non-interactive, and Login vs. Non-login
Login shell
- Start with 'bash --login' or 'bash -'
- Run the following config files: /etc/profile, ~/.bash_profile, then ~/.bash_login and lastly ~/.profile. When login shells exit, they read ~/.bash_logout.
Nonlogin shell
- Read .bashrc
- Should not put any output-producing code in this file because the standard stream could be redirected.
No comments:
Post a Comment