[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to determine if symbolic link is dangling?



On Sat, 22 Mar 1997 17:59:26 EST Jean Pierre LeJacq 
(jplejacq@quoininc.com) wrote:

> I'm trying to complete the next release of wn and have run
> into a problem.  I need to recurse through /usr/doc and find
> all the (sub)directories.  I want to be able to support
> symbolic links to directories outside /usr/doc hierarchy.
> Unfortunately there will be dangling symbolic links.
> 
> I'm using the "find" utility to recurse through the
> directory hierarchy.  Is there a way to test if the link is
> dangling?

	find . -type l | \
	bash -c 'while read i; \
		do if [ ! -e $i ]; then echo $i; fi; \
		done' 

Phil.




Reply to: