X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:content-type; q=dns; s=default; b=PBbf7cI
	OcsQJsvQKHwtsKh05/M9i9uRv8qp9j6HE5C50P3/c+KSjlHikmBeACPhVv127p3v
	E3ryP+d5F6kCW/jKjHdQ4L2ROCd2Haw9GFvKC5nfBVgRMscGMtMbFngvO4Ak7Nqg
	LcH/5LqljCYwm95/pG4fYnhczBE0DWsyTkj0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:content-type; s=default; bh=9MISrQYClX4eZ
	KWwSwmPe5m7Z0k=; b=Dudywk5gsvYeNiL812Xg+RLwRnSIpkfdqr9Wsot2efMn2
	/3EYnssBBBmV/AyNVz7XSx44tC9CZoBmFwKPm/qp2GSj7mneM/FcxLJ9/WUaMrIM
	n7zA8vEw9P6AAO1C16MOYcCWTdij2wMBVGwa8hBSBCe+RNm9z51OqafLWDbh6c=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL,BAYES_20,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=calgary, Calgary, Helmut, Hx-languages-length:1467
X-HELO: mail-qk0-f174.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20130820;        h=x-gm-message-state:mime-version:in-reply-to:references:from:date         :message-id:subject:to;        bh=oemR3cf59Gr6pZa3zGDWVDYdSusEg9lH5qzrPKZrt04=;        b=LM/h7jq+jKufAAiJzoc9RrkRbtReFBMtFGDCnLiM1YtuHtgIGLKYhkyAYSGLQtAlew         9ufJZg91M9yj+jXfrBEFb1n5v9Fd3aYCI1aVBsUBqarEy0a2lPbyGuIjTSJ1f+4/KLUx         uc1WRuU4oI5vpo/r+szNtaQ2SmdeuSkA4eACJodHKsI+TYr+tLzWEBmTPg1Op+RfGOAj         Ih0JRP0XKgVt73TRYRvfMHznkc4+58XY+YjxjtOTA/LgNjjn0/soPKTBHKBOdvwaTDzS         2iybH42kF3xFQYjjdmND+g9IrI4Q6OAWVR33ozBQbW1v2csrHJ8931fK3dB857Ubd4EN         Eg3A==
X-Gm-Message-State: AE9vXwMFsj3q3/bxPISpn880Wt20ToMXmRlD1+ZwJ+TuQ7AM0FtQiaAtc0wS1xU7lf3hg5Zvh75GV+EO1XpTuw==
X-Received: by 10.55.148.193 with SMTP id w184mr36076488qkd.181.1473048499692; Sun, 04 Sep 2016 21:08:19 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <87fupfsxx2.fsf@Rainer.invalid>
References: <op.x88uwyt9ofd6j1@frascati.upc.de> <87fupfsxx2.fsf@Rainer.invalid>
From: Doug Henderson <djndnbvg@gmail.com>
Date: Sun, 4 Sep 2016 22:07:59 -0600
Message-ID: <CAJ1FpuMCEAVN+-2VcUOnuyxXEWA3FYAuJ8HcAXp0B3z8cJHzeA@mail.gmail.com>
Subject: Re: /etc/profile: avoid multiple /usr/bin in PATH
To: cygwin <cygwin@cygwin.com>
Content-Type: text/plain; charset=UTF-8
X-IsSubscribed: yes

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

