You are not logged in.
Ohai,
I recently read the man page for bash because I wondered why there is a .bashrc and a .bash_profile, and what they are used for.
So if I understand this correctly: .bash_profile gets sourced in any case, .bashrc is only used if the invoked shell is interactive.
So in the /etc/skel/ dir are both of these files, but bash_profile is sourcing .bashrc if it exists and then in .bashrc there is a line that exits parsing if the shell is not interactive.
Which looks kinda redundant because it should not have been read in the first place, but still: Is there a reason for those two lines to be there?
Am I missing something?
.bash_profile
[[ -f ~/.bashrc ]] && . ~/.bashrc.bashrc
# If not running interactively, don't do anything
[[ $- != *i* ]] && returnOffline
They basically do the same, with a little difference.
If bash is invoked as a interactive login shell, bash_profile is used.
If bash is invoked as a interactive shell, that is not a login shell, bashrc is used.
So using bash trough xterm in your WM uses bashrc.
Offline