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

Re: finding symlinks without target



On Jan 23,  3:47pm, Sven Guckes wrote:
} Subject: finding symlinks without target
}
} Find (and print) all symbolic links without a target within the current
} dirtree.

	file **/*(D@) | fgrep broken

(You may need to change the grep if you're not using GNU `file`.)

Oh, you want it all in zsh?

	for i in **/*(D@); [[ -f $i || -d $i ]] || echo $i

But I think the pipe to fgrep would be faster.  (Why isn't there a glob
qualifier to chase links?  **/*(@^.,@^/) would appear to be perfect, but
doesn't work.)

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



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