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

Re: globbing based on symlink contents



Roderick Schertler wrote:
>It would be great to be able to glob based on the contents of symlinks.
>(That's not already possible, is it?  I've been resorting to find.)

It's not already possible.  And I think it would not be sufficient.
There will always be another way the people will want to glob.  The only
really general way to do it is to glob using arbitrary shell code as
the criterion.  How about a syntax like

linkmatch () {
  local a
  stat -L -A a $1
  [[ "$a[14]" == $~2 ]]
}
echo *(f{linkmatch}{foo*bar})

?

-zefram



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