public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Doug Henderson <djndnbvg@gmail.com>
To: cygwin <cygwin@cygwin.com>
Subject: Re: /etc/profile: avoid multiple /usr/bin in PATH
Date: Mon, 05 Sep 2016 04:08:00 -0000	[thread overview]
Message-ID: <CAJ1FpuMCEAVN+-2VcUOnuyxXEWA3FYAuJ8HcAXp0B3z8cJHzeA@mail.gmail.com> (raw)
In-Reply-To: <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
>> cygwin-PATH.
>>
>> 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.

    https://www.google.ca/search?q=CYGWIN_NOWINPATH+site:cygwin.com

CYGWIN_USEWINPATH is also undocumented, except in a non-cygwin.com
email archive.

Thanks,
Doug

-- 
Doug Henderson, Calgary, Alberta, Canada

--
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

  reply	other threads:[~2016-09-05  4:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-06 22:47 Helmut Karlowski
2015-12-08 21:01 ` Achim Gratz
2015-12-08 21:17   ` Helmut Karlowski
2015-12-08 21:21     ` Achim Gratz
2015-12-08 21:26       ` Helmut Karlowski
2015-12-08 21:31         ` Helmut Karlowski
2015-12-08 21:59           ` Helmut Karlowski
2016-09-04 11:32 ` Achim Gratz
2016-09-05  4:08   ` Doug Henderson [this message]
2016-09-05 17:57     ` Achim Gratz
2016-09-05 18:13       ` Vince Rice
2016-09-05 19:07         ` Achim Gratz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ1FpuMCEAVN+-2VcUOnuyxXEWA3FYAuJ8HcAXp0B3z8cJHzeA@mail.gmail.com \
    --to=djndnbvg@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).