delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/12/08/16:17:24

X-Recipient: archive-cygwin AT delorie DOT 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:content-type:to:subject:references:date
:mime-version:content-transfer-encoding:from:message-id
:in-reply-to; q=dns; s=default; b=e51LRb5d54M2GqGPP0aA3jA7Hj+dqM
MwvKSRu9f9fKILgr8oTVmZNySH8LF518H/AebJBwm7kNW9amYPtkbGjIVgba0M9U
+2i4gtfgYCwMNVlre7EUeu966JdSL7PDoqSnaiJpEcf3YsYAbi4bs4wBfE/cBx9C
TkaO9l7eeK8Zc=
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:content-type:to:subject:references:date
:mime-version:content-transfer-encoding:from:message-id
:in-reply-to; s=default; bh=g4NF4whA+t2co2hYgnER1l3/RNQ=; b=YILF
28vp3R4D2vGDJiycocxw37pZaaWF7JE1qDDZOJRvhtcfq5GVMt/Ls1AwLzWTU/GV
+gUbuKQVoRc1GuBWnaM9p4l/wMbrL7Br6ThnImHaXpYv49LcEBjZRydDbKRnuizp
uEfcxYrlYF+FYLKdZfmFfpk5LfqIE6SYsbtIJ44=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: mailout.ish.de
X-Abuse-ID: hremUFXL0y-8240 AT umkbw DOT customer
To: cygwin AT cygwin DOT com
Subject: Re: /etc/profile: avoid multiple /usr/bin in PATH
References: <op DOT x88uwyt9ofd6j1 AT frascati DOT upc DOT de> <87oae0venj DOT fsf AT Rainer DOT invalid>
Date: Tue, 08 Dec 2015 22:17:01 +0100
MIME-Version: 1.0
From: "Helmut Karlowski" <helmut DOT karlowski AT ish DOT de>
Message-ID: <op.x9cf2njrofd6j1@frascati.upc.de>
In-Reply-To: <87oae0venj.fsf@Rainer.invalid>
User-Agent: Opera Mail/12.17 (Win32)
Outgoingd: 0.4.0_m1
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019