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

Finding symbolic links that are outside a tree (comp.unix.shell)



Hi, this has originally been posted to comp.unix.shell by "rh0dium
<sklass@xxxxxxxxxxxxxxx" and I couldn't find a solution for zsh.

So can this be done with zsh globbing? I couldn't get any further as
"print -l **/*(@)" which prints only symbolic links but doesn't do
anything for "that are outside a tree".

Thorsten

******************************************************************
Can anyone help me with a simple script to find links ouside of a
tree.
 What I want is given the following tree two results would show up

tree
   a
      1 -> ../b
      2
   b
      1 -> ../../../foo
      2 -> ../c/1
   c
      1 ->/foo/bar
      2

So I would expect 2 results
b1 and c1 should be the output.  I just can't think of a slick way to
script this.  Anyone care to offer a bit of assistance?

I'd love a zsh function or bash function which does this.
******************************************************************



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