# --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
--noprofile
to disable- on startup
/etc/profile
/etc/bash.bashrc
/etc/profile.d/*.sh
~/.bash_profile
or~/.bash_login
or~/.profile
~/.bashrc
- on exit
~/.bash_logout
- non-login interactive shell
--norc
to disable- on startup
/etc/bash.bashrc
~/.bashrc
- non-login non-interactive shell
- doesn't source anything