This is the mail archive of the
mailing list for the Cygwin project.
Re: /etc/profile: avoid multiple /usr/bin in PATH
- From: Doug Henderson <djndnbvg at gmail dot com>
- To: cygwin <cygwin at cygwin dot com>
- Date: Sun, 4 Sep 2016 22:07:59 -0600
- Subject: Re: /etc/profile: avoid multiple /usr/bin in PATH
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <87fupfsxx2.fsf@Rainer.invalid>
On 4 September 2016 at 05:32, Achim Gratz wrote:
> 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
>> The attached patch fixes this.
> I've added the option to just use the already set-up PATH variable from
> Windows for this use case. Set CYGWIN_USEWINPATH before starting up.
Please make sure that this version of cygwin.bat will work correctly
when CYGWIN_NOWINPATH=1 is set in the windows environment.
I use this to isolate my cygwin environment from random windows stuff.
When I need to execute windows executables, I wrap the call in a
script or alias that makes just enough of the window's path available
to let it work.
This makes it much safer when running multiple cygwins, intentionally
for 32bit and 64bit, or unintentionally as when running windows apps
that include a cygwin.dll, e.g. GitHub for Windows. Also it avoids
accidentally running non-cygwin versions of *nix programs such as can
happen when you have Gnu for Windows or MSYS in your windows path.
Note that CYGWIN_NOWINPATH is still undocumented, except in the email
archives. See, e.g.
CYGWIN_USEWINPATH is also undocumented, except in a non-cygwin.com
Doug Henderson, Calgary, Alberta, Canada
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple