From: Keith M. <kei...@us...> - 2006-05-17 23:17:13
|
On Wednesday 17 May 2006 12:47 pm, Earnie Boyd wrote: > Quoting Gianluca Sforna <gi...@gm...>: > > Hi, > > is there a reason why the default /etc/profile in msys lacks > > something like: > > > > if [ -f $HOME/.bashrc ]; then > > . $HOME/.bashrc > > fi > > > > so users can customize their environment without messing with the > > system one? > > I don't consider this an appropriate question for this list. With respect, Earnie, I disagree. The question Gianluca has posed relates to the practicality of inserting additional code into /etc/profile; this is a file which we distribute with MSYS. Therefore, the question has implications for the MSYS distribution, which require a developers' decision, so I *will* answer on this basis. Although I know that some, perhaps many, Linux distributions do this, I believe it is wrong to add this code to /etc/profile. I have two reasons for this, namely: 1) The decision as to whether or not the commands in $HOME/.bashrc should be sourced by a login shell should rightfully be delegated to the user. By coding such commands into /etc/profile, the system administrator, or worse the distributor, denies the user his right to make this decision. While this *may* not create any great inconvenience for the user, it is unnecessary, and quite simply, sheer bad manners. 2) Enforcing such a startup action actually *prevents* bash from performing it's normal startup initialisation! $HOME/.bashrc is *not* supposed to be read by a login shell; by design, it is intended only to be read by secondary shells. For login shells, the equivalent files are $HOME/.bash_profile and $HOME/.profile, and either of these *will* be read, as appropriate, without any need for specifying the action in /etc/profile. > Please ask this question on users list. Yes, I do agree that there is a place for further discussion of the bash startup sequence, particularly in relation to the use of $HOME/.profile, $HOME/.bash_profile and $HOME/.bashrc, and that place is not here -- it is on one of the users lists, with mingw-msys being my preferred choice. I don't have time to expand on this right now, but may get a chance to post something there, over the weekend. Regards, Keith. |