Running Ubuntu 12.04.
I have a script that sets up the environment, its run by /etc/bash.bashrc
. (It may be set to run by other shell profiles inits, I didn't actually set it up myself)
When I Ctr+Alt+T
to open a terminal, the script runs once. But if I SSH into my machine from another box, the /etc/bash.bashrc
init script runs, but then it also gets run again, and I'm not sure why.
Other users experience the same 'double' initialize. It's not necessarily a problem, but I would really like to isolate the issue for academic reasons.
I added an echo into /etc/bash.bashrc
to let me know when it's executing. I see the echo the first time, but not the second time, leading me to believe something else is executing the script, I just can't figure out what it is. I checked ~/.profile
, ~/.bashrc
, and ~/etc/profile
I should emphasize that this behavior only happens when a user SSHes into the machine. I know there is some difference between interactive/login/non-login shells, but I'm not quite clear on the matter yet...
.bash_profile
, or the/etc/profile
source/etc/bash.bashrc
? – Kusalananda Jun 30 '16 at 21:09