Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: :a modifier resolves symlinks - docs say it shouldn't
- X-seq: zsh-workers 54640
- From: dana <dana@xxxxxxx>
- To: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- Cc: Langbart <Langbart@xxxxxxxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: :a modifier resolves symlinks - docs say it shouldn't
- Date: Fri, 29 May 2026 23:11:02 -0500
- Archived-at: <https://zsh.org/workers/54640>
- Feedback-id: i9be146f9:Fastmail
- In-reply-to: <CAHYJk3S0s_KR6hSEmu36d_n+FFr7d4-WCtvBvhDxyNoYiKMPcA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <3zfe8vYH0x3FIyV2DENCazumVzxZW1PaRfZDwO8lTNdgANVSd7stvo2T5XDHRI9H6RY5JE-VoXkF6df5Mw7BPiEmCzsPwcjMf8Bf1zs9bNw=@protonmail.com> <CAHYJk3S0s_KR6hSEmu36d_n+FFr7d4-WCtvBvhDxyNoYiKMPcA@mail.gmail.com>
On Fri 29 May 2026, at 22:46, Mikael Magnusson wrote:
> I suppose you may expect it to prepend $PWD rather than the current
> directory for relative paths, but that is not the case.
what it prepends instead of the result of getcwd(3), about which posix
says:
> The getcwd() function shall place an absolute pathname of the current
> working directory in the array pointed to by buf, and return buf. The
> pathname shall contain no components that are dot or dot-dot, or are
> symbolic links.
imo it would be nice if it *did* prepend $PWD, that feels like the
expected thing. in the past i've just done that myself where it matters,
and it seems to work in the common case:
[[ $dir == /* ]] || dir=$PWD/$dir
dir=${dir:a}
but i think there are some other cases where $PWD itself is not what
you'd expect? not sure
dana
Messages sorted by:
Reverse Date,
Date,
Thread,
Author