This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: /etc/profile in BASH


I gotta learn to read more carefully... :-\

One more time -- having these two lines in /etc/profile means that
~/.profile will be (potentially) sourced twice (~/.bashrc might be as well
depending on how the user handles it in ~/.profile).  This could have
unintended consequences where people *add-to* instead of *set* their
environment variables -- particularly PATH.  This could double the length of
the PATH variable and slow down access to commands (particularly if one or
more items on the PATH is a network share).

Also, in order to be compatible with other UNIX system shells (Kshell), a
user may have setup ~/.profile particularly for KShell and ~/.bash_profile
particularly for BASH.  Since BASH will not read ~/.profile if it finds
~/.bash_profile (or ~/.bash_login), the user does not have to do any testing
in his .profile to handle BASH vs. KSH idiosyncracies.  With SAMBA, NFS, and
such, it is possible that the user has one and only one HOME directory that
is used on all systems.  Sourcing ~/.profile out of /etc/profile could cause
the wrong setup to occur (remember the previous paragraph).

> -----Original Message-----
> From: Earnie Boyd [mailto:earnie_boyd@yahoo.com]
> Sent: Friday, September 29, 2000 11:36 AM
> To: Masterson, Dave
> Cc: 'cygwin@sources.redhat.com'
> Subject: RE: /etc/profile in BASH
> 
> 
> --- "Masterson, Dave" <dmasters@rational.com> wrote:
> > Doh! You're right!  Memory is the second thing to go as you 
> > get older...
> > 
> > However, I still don't think these two lines to run 
> > ~/.profile and ~/.bashrc
> > belong in /etc/profile (neither does "cd $HOME").  They subvert the
> > "--noprofile" and "--norc" options to BASH.
> > 
> 
> Subvert --noprofile?  No, /etc/profile wouldn't be sourced.  
> Subvert --norc? 
> No, /etc/profile isn't sourced unless it's login and 
> ~/.bashrc isn't sourced if
> it is login.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]