#!/bin/csh -f
# csh script to find and print outdated symbolic links, searching 
# (recursively) downwards into the specified directories.
# 	By Mike Schwartz, 11-20-85.
# 	University of Washington Computer Science Department
# 	ihnp4!uw-beaver!schwartz  (USENET)
# 	schwartz@wally.arpa  (ARPANET)
# 	schwartz%wally.arpa@csnet-relay.arpa  (CSNET)

if $#argv == 0 then
	echo Usage: oldlinks \<directory\> \[\<directory\>, ...\]
	exit 1
endif
foreach i($*)
	find $i -type l -print | sed 's/\(.*\)/if !(-e \1) echo \1/' > /tmp/tstlinks.$USER
	source /tmp/tstlinks.$USER
end

rm /tmp/tstlinks.$USER
