From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33895 invoked by alias); 5 Sep 2016 04:08:32 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 33887 invoked by uid 89); 5 Sep 2016 04:08:31 -0000 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 Received: from mail-qk0-f174.google.com (HELO mail-qk0-f174.google.com) (209.85.220.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Sep 2016 04:08:21 +0000 Received: by mail-qk0-f174.google.com with SMTP id t7so180746267qkh.1 for ; Sun, 04 Sep 2016 21:08:21 -0700 (PDT) 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 Received: by 10.55.164.194 with HTTP; Sun, 4 Sep 2016 21:07:59 -0700 (PDT) In-Reply-To: <87fupfsxx2.fsf@Rainer.invalid> References: <87fupfsxx2.fsf@Rainer.invalid> From: Doug Henderson Date: Mon, 05 Sep 2016 04:08:00 -0000 Message-ID: Subject: Re: /etc/profile: avoid multiple /usr/bin in PATH To: cygwin Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00076.txt.bz2 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