delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/08/08/11:22:30

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Wed, 8 Aug 2001 11:20:20 -0400
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: pwd-problem
Message-ID: <20010808112020.F4406@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <003101c11ff4$d4441f00$0200000a AT phoenix> <3B714E1E DOT 42DABFD5 AT coreenetworks DOT com>
Mime-Version: 1.0
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/

- Raw text -


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