cd and pushd do not set $PWD and $cwd correctly in tcsh on NT

Randall R Schulz rrschulz@cris.com
Fri Oct 25 14:52:00 GMT 2002


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@putnam.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/



More information about the Cygwin mailing list