#!/bin/bash
#
# find broken links in current directory
# improved(?) version that works for names with spaces, and uses
# a different method for checking for broken links
#
find . -type l | \
while read link
do
	target=$(readlink "$link")
	pushd `dirname "$link"` >/dev/null
	if [ ! -e "$target" ]
	then
		echo for link "$link", target "$target" not found
	fi
	popd >/dev/null
done
