#!/bin/sh - # # Finds and displays broken symlinks in a file hierarchy. # By default it starts searching at the current directory, # but you may specify one or more directories on the # command line. # if [ $# -gt 0 -a ! -d "$1" ]; then echo "Usage: `basename $0` [ ...]" >&2 exit 1 fi if [ $# -lt 1 ]; then DIRS="." else DIRS="" fi find $DIRS "$@" -type l \ | while read LNK; do if [ ! -f "$LNK" ]; then echo "$LNK" fi done #--