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

Re: glob qualifier '-' doesn't work correctly on dangling symlinks

Vincent Lefevre wrote on Sun, 12 Apr 2020 01:48 +0200:
> On 2020-04-11 21:37:14 +0100, Stephane Chazelas wrote:
> > find -xtype l and *(-@) are common, documented idioms. If only
> > for that, I don't think the behaviour should be changed.
> > 
> > And it's not clear what the better behaviour would be.
> > 
> > If that broken link should not be matched by *(-W), should it be
> > matched by *(-^W)? Why?  
> No, just like file0(^W) gives "zsh: no match" (as file0 does not exist).
> > Or should that fail the glob (cause the shell process to exit)?  
> The shell process should not exit (except with "set -e").
> The behavior should be: replace the link by the target, then
> apply the glob qualifiers.

To be explicit, then, the proposal is that «brokensymlink(-W)» and
«brokensymlink(-^W)» should both trigger the "no match" error?  (I.e.,
the target of a broken symlink is neither writable nor not writable.)

What should «brokensymlink(-)» do?

What would be the glob qualifier syntax for broken symlinks?


(ENOTIME, so not expressing an opinion and not diving into the various
points being made; just wanted to clarify a few points.)

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