delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/05/04/01:14:14

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Message-ID: <42785B91.6060601@itee.uq.edu.au>
Date: Wed, 04 May 2005 15:20:17 +1000
From: John Williams <jwilliams AT itee DOT uq DOT edu DOT au>
Reply-To: jwilliams AT itee DOT uq DOT edu DOT au
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040316
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: pwd vs $PWD, bash, cygwin vs Linux
References: <4278209B DOT 1050903 AT itee DOT uq DOT edu DOT au> <20050504011021 DOT GC23476 AT trixie DOT casa DOT cgf DOT cx> <42785047 DOT 2020505 AT itee DOT uq DOT edu DOT au> <20050504045236 DOT GF24661 AT trixie DOT casa DOT cgf DOT cx>
In-Reply-To: <20050504045236.GF24661@trixie.casa.cgf.cx>
X-Spam-Checked: This message probably not SPAM
X-Spam-Score: 0
X-IsSubscribed: yes
Note-from-DJ: This may be spam

Christopher Faylor wrote:

>>>In this case, the operative observation is bash != ash.  PWD is a bash
>>>construct.  You would be much better off just using the gnu make
>>>"CURDIR" variable.  Changing PWD to CURDIR in your examples makes things
>>>work as you'd expect.
>>
>>Thanks for the quick response and workaround.
>>
>>While what you say might be a true statement, "better off" means 
>>different things to different people!
> 
>>What surprised me was that the same shell, and same make, resulted in 
>>different behaviour.  I guess this is just reflecting differences in the 
>>underlying process architectures of Linux vs Windows.
> 
> Again, it *isn't* the same shell.  You have now learned that it isn't
> the same shell and you now know that this is the reason for the
> inconsistency.  ash isn't normally used as /bin/sh on linux.  A stripped
> down version of ash is used as /bin/sh for performance purposes on
> cygwin.  ash does not set PWD.

OK - I see the confusion.  Make is spawning ash as the subshell, not 
bash.  Now everything you said makes sense.  Out of interest, can that 
behaviour be modified at the runtime/user/Makefile level?

Cheers,

John

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