Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    This is far more than I ever expected. Thank you, and extra thanks for the further reading! Commented Dec 27, 2017 at 9:27
  • doc.cat-v.org/plan_9/4th_edition/papers/lexnames talks about some of the problems with .. in the context of Plan9, Commented Dec 27, 2017 at 16:12
  • @JdeBP: Perhaps I’m missing something.  You say, “Internally, within …, bash, … and …, the shell additionally keeps track of the working directory using string manipulation of an internal string variable.  …, it adjusts the string to remove . and .. components and to chase down symbolic links replacing them with their linked-to names. …  The name in the internal string variable is tracked by a shell variable named PWD …” (emphasis added).  … (Cont’d) Commented Mar 8, 2018 at 8:18
  • (Cont’d) … But your example shows PWD = …/b after a cd b command, even though b is a symbolic link to a — so the shell doesn’t “chase down” the a -> b link. Did you misstate, or did I misread? Commented Mar 8, 2018 at 8:18
  • I simply glossed over a side point, and pointed you to the code for details. See the various shells' manuals for when and how they decide to chase symbolic links or not. The Z shell handily calls its shell option that is one part of the decision formula, CHASE_LINKS. Commented Mar 8, 2018 at 8:40