symbolic link question
Steven W. Orr
steveo at syslang.net
Tue Dec 3 15:13:52 EST 2002
On Tue, 3 Dec 2002, Price, Erik wrote:
=>Hello,
=>
=>I have created a symbolic link in my home directory that points to
=>another directory on the server. This is a nice shortcut to that other
=>directory. However, when I cd into the other directory through my
=>symbolic link, then echo the current working directory with either "pwd"
=>or "echo $PWD", the pathname takes into account the fact that I accessed
=>it from a symbolic link.
=>
=>I'm not disputing this, but rather I'm curious of what's keeping track
=>of this -- my shell session (bash)? I would have made the assumption
=>that once I switched to the other directory, I am now for all intents
=>and purposes in that other directory with no memory of the original, but
=>in this I am wrong.
=>
=>I'm not really new to Unix but I must admit that I've never really
=>experimented with symlinks before.
=>
=>(Also, I've found a nice workaround is to use an environment variable
=>containing the path to the other directory, and instead of "cd
=>symLinkedDirectory" just use "cd $otherDirectory".)
If you don't like that behavior use set -P in bash to shut it off.
Also, look at cdable_vars which would allow you to say cd otherDirectory
--
-Time flies like the wind. Fruit flies like a banana. Stranger things have -
-happened but none stranger than this. Does your driver's license say Organ
-Donor?Black holes are where God divided by zero. Listen to me! We are all-
-individuals! What if this weren't a hypothetical question? steveo at syslang.net
More information about the gnhlug-discuss
mailing list