The second way to tell bash to run as a "login" shell is with the
--login command-line option. This is sometimes used by terminal
emulators (like xterm) to make their bash sessions act like
initial login sessions.
After you have logged in, more copies of your shell will be run. Unless
they are started with --login or have a dash in the process name,
these sessions will not be "login" shells. If they give you a prompt, however,
they are called "interactive" shells. If bash is started as "interactive", but
not "login", it will ignore /etc/profile and
~/.bash_profile and will instead source ~/.bashrc.
interactive | login | profile | rc |
yes | yes | source | ignore |
yes | no | ignore | source |
no | yes | source | ignore |
no | no | ignore | ignore |