Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

$PWD and ~+ (and others) in documentation



Hi,

I noticed that PWD can be assigned to, and found a thread from 98
where it was discussed a bit. Apparently some scripts like to assign
to it and they were broken under zsh. The "problem" is that the
documentation says things like

       %/     Present working directory ($PWD).  If an integer follows
the  `%',  it
              specifies  a number of trailing components of $PWD to
show; zero means
              the whole path.  A negative integer specifies leading
components, i.e.
              %-1d specifies the first component.

However, after PWD has been assigned to, %/ still shows the actual
current directory, not the value of $PWD. The same applies to ~+, ~-
(and $OLDPWD), %~ and probably other things.

The above section could be said to introduce $PWD as a local
abbreviation of "Present working directory", but this section for
example doesn't

       A  `~'  by itself is replaced by the value of $HOME.  A `~'
followed by a `+'
       or a `-' is replaced by the value of $PWD or $OLDPWD, respectively.

Should I fix this, or does nobody care? And by fix, do I mean changing
the appropriate occurrences of "$PWD" to "the current working
directory" or something else? :)

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author