delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/06/18/06:30:48

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Wed, 18 Jun 2008 12:30:22 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin app not receiving modified PATH env var
Message-ID: <20080618103022.GC20180@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20080617034152 DOT GD7632 AT samus DOT subfocal DOT net> <20080618010536 DOT GE7632 AT samus DOT subfocal DOT net> <20080618080059 DOT GF7632 AT samus DOT subfocal DOT net> <20080618085118 DOT GB20180 AT calimero DOT vinschen DOT de> <20080618093016 DOT GG7632 AT samus DOT subfocal DOT net>
MIME-Version: 1.0
In-Reply-To: <20080618093016.GG7632@samus.subfocal.net>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Jun 18 05:30, Mike Mueller wrote:
> Obviously PATH is special to cygwin, because it has to transform the
> Windows representation into a Unix-like representation.  I agree with
> you that it *should* be pulled in like any other variable, but I'm not
> familiar with cygwin's under-the-hood workings.  This problem has me
> completely at a loss...

As I said, PATH is fetched with GetEnvironmentStrings from the env like
every other environment var, if the Cygwin app has been started by a
native parent.  It's just massaged into a POSIX path afterwards.
There's no magic involved like, say, some hidden mechanism to get the
environment from the grandparent or something.

Try this:

bash-3.2$ echo $PATH
/home/corinna/bin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/SFU/common/
$ cmd
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\cygwin\home\corinna>echo %path%
C:\cygwin-1.5\mnt\c\cygwin\home\corinna\bin;C:\cygwin-1.5\bin;C:\cygwin-1.5\usr\local\bin;C:\cygwin-1.5\bin;C:\cygwin-1.5\bin;C:\cygwin-1.5\usr\X11R6\bin;c:\windows\system32;c:\windows;c:\windows\System32\Wbem;C:\cygwin-1.5\mnt\c\SFU\common\

c:\cygwin\home\corinna>set path=%path%;C:\

c:\cygwin\home\corinna>echo %path%
c:\cygwin\home\corinna\bin;C:\cygwin-1.5\bin;C:\cygwin-1.5\usr\local\bin;C:\cygw
in-1.5\bin;C:\cygwin-1.5\bin;C:\cygwin-1.5\usr\X11R6\bin;c:\WINDOWS\system32;c:\
WINDOWS;c:\WINDOWS\System32\Wbem;c:\SFU\common\;C:\

c:\cygwin\home\corinna>bash
bash-3.2$ echo $PATH
/cygdrive/c/cygwin/home/corinna/bin:/usr/bin:/usr/local/bin:/usr/bin:/usr/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/SFU/common/:/cygdrive/c

Well, works for me, obviously.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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