Does Bash follow man bash INVOCATION conventions?
Using Knoppix 3.8 and setting up my customizations for saveconfig.
I put echo statements in /home/knoppix.bashrc and /etc/profile to see
how they run. Knoppix is otherwise virgin.
When I click on an xterm I get the following display:
executing /etc/profile
executing ~/.bashrc
executing /etc/profile
Why is bash executing /etc/profile when I click on Konsole in KDE which
is a "non-login" shell?
I see that ~/.bashrc sources /etc/profile which explains why it runs
after .bashrc but why does it run the first time?
According to man bash INVOCATION section:
An interactive logon session reads/executes /etc/profile if it exists,
then reads/executes the first found of ~/.bash_profile, ~/.bash_login or
~/.profile. None of the last three are found in Knoppix 3.8 so only
/etc/profile should be executed.
A non-login shell reads and executes /etc/bashrc.bashrc if found _and_
reads and executes ~/.bashrc. Since only .bashrc exists in Knoppix 3.8
only ~/.bashrc can run.
Curious.
--
Larry Alkoff N2LA - Austin TX
Using Thunderbird on Slackware Linux
Reply to: