This is a minor and cosmetic bug report about the default structure of bash dot files: /etc/bashrc /etc/profile /etc/skel/.bashrc /etc/skel/.bash_profile (Note, these are spread over *three* packages: bash, setup, and etcskel.) Irritated and inspired by the fact that the default files set the prompt in two places because someone couldn't figure it out, I think I have it figured out and have a suggestion for fixing it. From the bash man page, bash initializes itself differently under login and non-login conditions: Under login, it loads /etc/profile (if it exists) and then ~/.bash_profile (if it exists). Under non-login, it loads .bashrc (if it exists) The default files with Redhat do roughly the following: /etc/profile -- sets up a bunch of stuff, including environment, umask, and prompt ~/.bash_profile -- source ~/.bashrc ~/.bashrc -- source /etc/bashrc /etc/bashrc -- set the prompt (again!) Under a login shell, this flows smoothly in order. But under a non-login shell, bash only starts at ~/.bashrc, doing nothing of the nice stuff in /etc/profile. All the real work gets done upfront where it can be skipped! This explains why the prompt has to be set again in /etc/bashrc. I prefer the following setup: /etc/profile -- does nothing! (no global executables) ~/.bash_profile -- sources ~/.bashrc ~/.bash_rc -- sources /etc/bashrc, sets prompts (since users typically customize this anyway!), aliases, and functions /etc/bashrc -- sets environments, paths, umasks, etc (i.e., all the stuff that /etc/profile used to do.) The advantage here is that regardless of whether bash is login or non-login, all the work gets done at the end via the same set of ~/.bashrc and /etc/bashrc files. For an example of my actual files, look at: http://hyperbolic.net/dotfiles.tar As an aside, the /etc/profile.d mechanism of allowing packages to customize the support they get from shell environements or aliases probably shouldn't be triggered out of /etc/profile for the same reasons I've outlined above, but out of /etc/bashrc instead. (I've not yet made this change in my own dotfiles, however.) I'm not sure how this plays out with other shells default methods of loading dotfiles, but it at least seems to be a more logical approach to the default bash configuration. David Golden <david>
You're trying to hash out the differences between a login shell and a non-login shell. The difefrences exist for a reason, and your workaround is a matter of taste and preference that I'm not going to argue about... This is just a matter of config files, and you seem to have figured out the environment you like. What we have now might not be the best setup, but at least is the least hated one...