Re: Filename generation: instruct zsh not to follow symbolic links?
Mikael Magnusson <[email protected]> Fri, 17 Jul 2026 19:18:26 +0200
| Newsgroups | gmane.comp.shells.zsh.user |
|---|---|
| Message-ID | <CAHYJk3S_s9kNSgqxas7Cqh9Cf26uhkXA3aZ8omeBbMi2dmp-EQ@mail.gmail.com> |
On Fri, Jul 17, 2026 at 6:33=E2=80=AFPM Bart Schaefer <schaefer@brasslanter= n.com> wrote: > > On Fri, Jul 17, 2026 at 3:50=E2=80=AFAM Vincent Lefevre <[email protected]= et> 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 =3D=3D $REPLY:A:h ]] || typeset -g reply=3D() } This might need to be :h:a and :h:A respectively, in case the foo symlink target has multiple components? --=20 Mikael Magnusson