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

Re: Filename generation: instruct zsh not to follow symbolic links?



On Fri, Jul 17, 2026 at 6:33 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Fri, Jul 17, 2026 at 3:50 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> >
> > But anyway, this doesn't really work: */foo(+nosym) also ignores the
> > cases where "foo" is a symbolic link, while in <dir>/foo, I would want
> > to ignore only the cases where <dir> is a symbolic link.
>
> That's easy:
>
> nosym() { [[ $REPLY:a:h == $REPLY:A:h ]] || typeset -g reply=() }

This might need to be :h:a and :h:A respectively, in case the foo
symlink target has multiple components?

-- 
Mikael Magnusson




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