Configuration file sequence for bash.
see : www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
Login configuration
/etc/profile
- system wide configuration
- automaticly read on login from terminal
- configures minimal defaults : prompt, path, etc.
- may read additional default resource files if told to.
- Our system is configured to read :
- /etc/bash.bashrc
- files in /etc/profile.d (system specific?),
$HOME/.bash_profile
- User specific profile
- automaticly read on successful login from terminal
- Only read on login or if a shell is started with --login.
- If .bash_profile not found, system will to run the 1st of the following
two alternatives it finds.
$HOME/.bash_login
$HOME/.profile
- May source .bashrc, a local resource file, or others.
Non login interactive shell configuration
/etc/bash.bashrc
- system wide configuration
- automaticly read when a non-login interactive shell is started.
- Or if called by /etc/profile
$HOME/.bashrc
- read for non-login instances of shell startup.
e.g scp, sftp, invoking bash from command line.
- Shouldn't contain standard output, eg. echo
- Shouldn't contain aliases that redefine standard commands to
be interactive unless conditionally assigned if PS1 defined.
$BASH_ENV
- May be assigned a resource file which is invoked when a non-interactive
bash shell is started, such as a shell script.
- Shouldn't contain standard output, eg. echo
Logout
$HOME/.logout
- read on logout.
- Can be used to reset or clean up login.
It is common to have the login configuration files invoke the non-login
interactive configuration files as part of the login process.
Examples :
/etc/profile
~/.bash_profile
/etc/bash.bashrc
~/.bashrc