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

Bart Schaefer <[email protected]> Thu, 16 Jul 2026 12:10:00 -0700
Newsgroups gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user
Message-ID <CAH+w=7YxNdDt6mAcUMc7cfgE0PatVU3vmB6h+_Yu6oSZ3XU5+w@mail.gmail.com>
% nosym() { [[ $REPLY == $REPLY:A ]] || reply=() }
% echo /tmp/foo/f/*
/tmp/foo/f/bang
% echo /tmp/foo/f/*(+nosym)
zsh: no matches found: /tmp/foo/f/*(+nosym)
% ls -ld /tmp/foo/*
drwxrwxr-x  3 schaefer  wheel  96 Jul 16 11:55 /tmp/foo/bar
lrwxrwxr-x  1 schaefer  wheel  12 Jul 16 11:55 /tmp/foo/f -> /tmp/foo/bar
% ls -ld /tmp/foo/*(+nosym)
drwxrwxr-x  3 schaefer  wheel  96 Jul 16 11:55 /tmp/foo/bar

(This specific example can be a little surprising on MacOS because
/tmp is itself a symlink to /private/tmp)