Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: ericblake AT comcast DOT net (Eric Blake) To: cygwin AT cygwin DOT com Subject: Re: pwd vs $PWD, bash, cygwin vs Linux Date: Wed, 04 May 2005 03:34:06 +0000 Message-Id: <050420050334.10743.427842AE000B7E3F000029F722058861720A050E040D0C079D0A@comcast.net> X-Authenticated-Sender: ZXJpY2JsYWtlQGNvbWNhc3QubmV0 > >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. POSIX requires /bin/sh to keep $PWD accurate, but ash does not meet POSIX requirements (in this and a number of other instances). PWD is not just for bash, it is for all compliant shells. Unfortunately, all of the open-source compliant shells come with so much extra weight (read: interactive features that aren't used by shell scripts, but that consume memory and slow down forks) that none of them have been deemed acceptable for replacing ash as cygwin's /bin/sh. Also, you can safely use /bin/pwd from coreutils to find out your real current directory, although it does not yet implement the POSIX-required -L vs. -P options. -- Eric Blake -- 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/