# --login/-l for login shell
shopt -q login_shell && echo 'login shell' || echo 'non-login shell'
# -i for interactive shell
[[ $- == *i* ]] && echo 'interactive shell' || echo 'non-interactive shell'- login shell
--noprofileto disable- on startup
/etc/profile/etc/bash.bashrc/etc/profile.d/*.sh
~/.bash_profileor~/.bash_loginor~/.profile~/.bashrc
- on exit
~/.bash_logout
- non-login interactive shell
--norcto disable- on startup
/etc/bash.bashrc~/.bashrc
- non-login non-interactive shell
- doesn't source anything