idallen@watmath.UUCP (03/26/84)
In a shell, if X is a symbolic link, then "cd /a/b/c/X/.." does not put
you in directory "/a/b/c". Similarly, a pwd(1) after "cd /a/b/c/X"
does not print "/a/b/c/X". My question is, for programs such as the C
Shell that try to keep track of where they are ($cwd), what should
happen? If you "cd /a/b/c/X", should your $cwd be /a/b/c/X or should
it be what pwd would show?
Another way of looking at this: should the path by which you "arrive"
at a particular directory be the path by which you "leave" using ".."?
Or, should you (as is currently done) always leave by the real link
".."? Since the C Shell keeps track of how you arrived at a directory,
it could behave either way.
I'm trying to resolve the confusion I feel when I "pass through" a
symbolic link (which I might not have been aware of) and then back up.
The C Shell is behaving half like my mind and half like pwd; thanks to a
bug in the directory resolution function, it sets $cwd as if you back up
along the path by which you got there, but it *really* backs up along
the real link ".." (resulting in complete confusion).
I am afraid that the C Shell will have to be fixed to conform to pwd,
since one wouldn't want "ls .." and "cd ..;ls" to behave differently.
This just means one gets a big surprise when passing through a
symbolic link. (*sigh*) Perhaps the shell will have to warn you when
this happens!
--
-IAN! (Ian! D. Allen) University of Waterloonotes@iuvax.UUCP (03/27/84)
#R:watmath:-737800:iuvax:1200006:000:534 iuvax!apratt Mar 26 19:13:00 1984 One way to fix this, I think, to work like your mind works is to do some clever aliasing: make "cd name" push the current directory to the directory stack, then change to name (possibly a link). make "cd .." change to the directory which is at the top of the directory stack, then pop the stack. It may have to be a script checking for ".." as the first arg to "cd", rather than a straight alias, but that would work, I think. -- Allan Pratt ...Just trying to be helpful... Posting this so people can poke holes in it...