On Sun, 2003-11-30 at 13:23, Andrew Gaffney wrote:
I recently installed tripwire on one of my Gentoo servers. Everytime I run it, I get ~250 warnings about files not existing, which are symlinks pointing to nothing. How can I find all invalid symlinks and delete them? Thanks.
( for f in $(find / ! -fstype proc -type l 2>/dev/null); do cd $(dirname "$f") 2>/dev/null && ! test -e "$(readlink "$f")" && echo "$f"; done )
This is giving me output like:
dirname: too few arguments Try `dirname --help' for more information. -bash: /usr/local/man: is a directory /usr/local/man dirname: too few arguments Try `dirname --help' for more information. -bash: /usr/local/doc: is a directory /usr/local/doc dirname: too few arguments Try `dirname --help' for more information. -bash: /usr/include/X11: is a directory /usr/include/X11 dirname: too few arguments Try `dirname --help' for more information. -bash: /usr/include/GL: is a directory /usr/include/GL
-- Andrew Gaffney
-- [EMAIL PROTECTED] mailing list