Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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
Date: Wed, 4 May 2005 00:52:36 -0400
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: pwd vs $PWD, bash, cygwin vs Linux
Message-ID: <20050504045236.GF24661@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
References: <4278209B.1050903@itee.uq.edu.au> <20050504011021.GC23476@trixie.casa.cgf.cx> <42785047.2020505@itee.uq.edu.au>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <42785047.2020505@itee.uq.edu.au>
User-Agent: Mutt/1.5.8i

On Wed, May 04, 2005 at 02:32:07PM +1000, John Williams wrote:
>Christopher Faylor wrote:
>>On Wed, May 04, 2005 at 11:08:43AM +1000, John Williams wrote:
>>
>>>Essentially under Cygwin the PWD variable seems to be "frozen" at its
>>>value upon first launching Make from the commandline, while under Linux
>>>it is being updated for each child process spawned by `make -C XXX`
>>>
>>>I know that Cygwin != Linux, however is it a reasonable expectation
>>>that under the same shells, the same behaviour should apply?
>>
>>
>>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!

"Better off" == "it works" vs.  "not better off" == "it doesn't work".

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

cgf

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

