Finding Broken Links

From: Sumair Mahmood (Sumair.Mahmood@qlogic.com)
Date: Mon Apr 29 2002 - 18:57:35 EDT


Respected Colleagues:

I have a number of broken symbolic links on the file systems of
computers which I manage.

I know I can find all of the symbolic links in a given filesystem using
the following :

        (1) ls -l | grep '^l'
        (2) find /dir -type l -exec ls -l {} \;

Is there a way, I wonder, to 'follow' a link to test to see if it is valid?
'ls -L' isn't reporting any errors for my broken links. I would like to
throw together a Bourne script to automate the process of finding
and deleting dangling links.

P.S. I wish I did, but I don't know Perl. If we could please limit this
        discussion to Unix shell scripting, I would appreciate it!

 Sumair Mahmood
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:24:16 EDT