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

Re: finding symlinks without target



On Jan 23,  4:42pm, Bruce Stephens wrote:
} Subject: Re: finding symlinks without target
}
} schaefer@xxxxxxxxxxxxxxxx said:
} > (Why isn't there a glob qualifier to chase links?  **/*(@^.,@^/) would
} > appear to be perfect, but doesn't work.) 
} 
} There is, isn't there.  The - seems to be right, almost.

Indeed.  I missed that one when scanning the zsh info (probably because
I was looking for a description that used the word "chase" as in the
CHASE_LINKS option).

} How about 
} **/*(@-^.,@-^/)
} 
} Meaning those symbolic links whose referents aren't files or directories?

I should have realized before that this won't work, because that's an
-inclusive- "or" and what's wanted is an -exclusive- "or".  However,
this appears to do the trick:

	echo **/*(@-^./=%p)

All symlinks that don't point to files, directories, sockets, devices,
or named pipes.  Whew.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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