#!/bin/bash # find-dead-links if [[ ! $1 ]] ; then echo "Give the path to a directory in which to look." else cd $1 && { for LINK in $(find -type l) ; do readlink -e $LINK 1> /dev/null if [[ $? != 0 ]] ; then echo "$LINK is bad" fi done } fi