3 ms·
Due to the same problem you mention, many Linux shell startup scripts are a mess as well. The /etc/profile actually reads in a /etc/bash.bashrc if $BASH is set
by erlkonig 15y ago
Due to the same problem you mention, many Linux shell startup scripts are a mess as well. The /etc/profile actually reads in a /etc/bash.bashrc if $BASH is set on Ubuntu, instead of taking the correct approach of letting Bash handles its own startup. One some system (either Redhat or Ubuntu or CentOS, can't remember which) ends up reading in bash's startup scripts in the wrong order - and the wrong number of times.
Instead of cramming things in /etc/profile (which really should only be about environment variables, where ~/.bashrc should pick most of them up from the parent process), just having ~/.bash_login read ~/.bashrc solves getting all your interactive bash startup commands into one file (assuming the /etc/skel/.* is used during account creation so users don't have to set that up themselves).