#/bin/bash echo "Checking for broken links..." find -L /usr/lib -maxdepth 1 -type l -ls echo echo "Checking equery for hints on owners.." for file in `find -L /usr/lib -maxdepth 1 -type l -print` do equery belongs `echo $file | sed 's/.*\///'` echo -n "Remove broken link for $file ?" read yn if test "$yn" = "y" then rm $file fi done echo echo "Checking deeper for broken links..." find -L /usr/lib -type l -ls echo echo "Checking equery for hints on owners.." for file in `find -L /usr/lib -type l -print` do equery belongs `echo $file | sed 's/.*\///'` echo -n "Remove broken link for $file ?" read yn if test "$yn" = "y" then rm $file fi done