Re: :a modifier resolves symlinks - docs say it shouldn't
Bart Schaefer <[email protected]>
| Newsgroups | gmane.comp.shells.zsh.devel |
|---|---|
| Message-ID | <CAH+w=7b-5NU1pnzXZUg4T9rixJq_q5iQ43yKmLbvwOM2zd0G3g@mail.gmail.com> |
On Fri, May 29, 2026 at 8:07 PM Langbart <[email protected]> wrote: > > a Turn a file name into an absolute path: prepends the current > directory, if necessary This does not say that symbolic links are preserved for "prepend the current directory." dir=${PWD}/x echo ":a ${dir:a}" echo ":A ${dir:A}" echo ":P ${dir:P}" :a /var/folders/6b/3xjb91g50kq0hpwdyqlry57w0000gp/T/tmp.ACSrdBvO3s/link/x :A /private/var/folders/6b/3xjb91g50kq0hpwdyqlry57w0000gp/T/tmp.ACSrdBvO3s/real/x :P /private/var/folders/6b/3xjb91g50kq0hpwdyqlry57w0000gp/T/tmp.ACSrdBvO3s/real/x That is, symbolic links encountered when interpreting the value of ${dir} are preserved (or more accurately, ignored), not when constructing an absolute path from a relative one afterward. You can see this more plainly if you change these two lines of your test: cd ${tmp_dir} # don't desend into link dir=link/x