delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/10/25/15:23:54

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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: <5.1.0.14.2.20021025121713.02c33eb0@pop3.cris.com>
X-Sender: rrschulz AT pop3 DOT cris DOT com
Date: Fri, 25 Oct 2002 12:23:20 -0700
To: cygwin AT cygwin DOT com
From: Randall R Schulz <rrschulz AT cris DOT com>
Subject: Re: cd and pushd do not set $PWD and $cwd correctly in tcsh
on NT
In-Reply-To: <OF7F1A5E43.A4A30871-ON85256C5D.0066E4B4@putnaminv.com>
Mime-Version: 1.0

Eugene,

The shells track the current working directly internally based on the 
invocation of cd, pushd and popd commands.

The binary executable "/bin/pwd.exe" must traverse the parent directory 
links to the root in order to discover the current working directory, since 
unlike the shells it has no prior notion of what the working directory is 
when it's invoked. It effectively reports a "canonical" curent directory name.

There are counterparts to the kinds of discrepancies you're seeing in 
everyday Unix and Linux systems. In those systems (and in Cygwin) symbolic 
links are the usual way these discrepancies arise (offhand, they're the 
only way in Unix and Linux, but I may be overlooking something).

There's really nothing to be done about the fact that directory names can 
be aliased, whether it's via Cygwin's unmounted drive directory (by 
default, "/cygdrive"), the aliasing that can occur in Cygwin do to its more 
flexible mount scheme or symlinks, which are equally possible in Cygwin and 
in Unix / Linux.

Randall Schulz
Mountain View, CA USA


At 11:56 2002-10-25, Eugene_Reznik AT putnam DOT com wrote:
>I am runnning into the following problem:
>
>
>1. start tcsh
>2. cd /
>3. cd c:/winnt
>
>After the last commnad the working directoy is /cygdrive/c/winnt. The
>output of the pwd command confirms this. However, both $PWD and $cwd are
>set to: /c:/winnt. See below:
>
>
>/cygdrive/d> cd /
>
>16 /> cd c:/winnt
>
>17 /c:/winnt> pwd
>/cygdrive/c/winnt
>18 /c:/winnt> echo $PWD
>/c:/winnt
>19 /c:/winnt> echo $cwd
>/c:/winnt
>20 /c:/winnt>


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