Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Wed, 8 Aug 2001 11:20:20 -0400
From: Christopher Faylor <cgf@redhat.com>
To: cygwin@cygwin.com
Subject: Re: pwd-problem
Message-ID: <20010808112020.F4406@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <003101c11ff4$d4441f00$0200000a@phoenix> <3B714E1E.42DABFD5@coreenetworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.11i
In-Reply-To: <3B714E1E.42DABFD5@coreenetworks.com>; from rramos@coreenetworks.com on Wed, Aug 08, 2001 at 10:35:10AM -0400

On Wed, Aug 08, 2001 at 10:35:10AM -0400, Richard Ramos wrote:
>Let me take this opportunity to describe some pwd-related behavior that
>I thought was unexpected.  Maybe we can hash out the whole "pwd" question.
>
>My not-so-informed opinion is that the behavior you see is what I would
>have expected since the command would have executed in you current
>directory.

pwd prints the current working directory.  If you cd to /, pwd will
print /.  I really don't understand how anyone could consider this
to be a bug.

>I put together a  script to illustrate the unexpected behavior I see:
>
>$cat testscr
>#! /bin/sh
>
>echo \$PWD=$PWD
>echo cd ..
>cd ..; echo pwd produces: `pwd`
>echo \$PWD = $PWD
>
>The output of the script is as follows:
>
>$ tstscr
>$PWD=/home/rramos
>cd ..
>pwd produces: /home
>$PWD = /home/rramos
>
>The pwd command seems to produce the result I would have expected
>(the directory changes according to the script) but the PWD variable stays
>fixed at the directory where I ran the script from.  I thought the PWD
>variable should have followed along.

The PWD variable is not used by ash.  If you want PWD to change use bash.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

