This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: /etc/profile: avoid multiple /usr/bin in PATH


Am 08.12.2015, 22:01 Uhr, schrieb Achim Gratz:

Helmut Karlowski writes:
I set C:/cygwin/usr/bin in my windows-environment. Now /etc/profile
always adds /usr/bin to PATH resulting in /usr/bin being twice in my
cygwin-PATH.

The attached patch fixes this.

I tend to reject this patch.  The purpose of the default profile is to
put those two paths in front, while with your patch they could end up
anywhere.  If you think that's OK for you, then you can already do that,

Not if they have not been present in the windows-path before. I personally want to keep the order I have in my windows-path, but tastes may differ. But the actual reason for me to change profile was that I had /usr/bin twice in my cygwin-path. That can be avoided with the original profile if the user also sets CYGWIN_NOWINPATH to something in the windows-environment, which I escaped me before, and then I would also have to set /usr/local/bin in windows. I find this overcomplicated for the user.

To force /usr/bin first in PATH would be doable of course.

but I don't think that's a good default.

It also sets SHELL if not yet set and avoids a call of hostname.

Can you tell me in which circumstances this happens and why this is a
problem?  SHELL is supposed to be the user preference, so I don't think
/etc/profile should try to second-guess it.

/etc/profile is run before ~/.profile, and if that does not set SHELL there will be none.

-Helmut

--

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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