Somehow my books forgot to list the "-l" file test operator. Thanks for the tip. Based on your tip, here's my new code. I need to do some additional formatting, but I think it will work quite nicely.
/UPDATE#!/opt/perl5/bin/perl $THISDIR="links/"; opendir THISDIR, "$THISDIR" or die "AACK: $!"; @allfiles = grep !/^\./, readdir THISDIR; closedir THISDIR; foreach $link (@allfiles){ $rc=readlink "$THISDIR$link"; if ((-l "$THISDIR$link") && ! -e $rc){ print "Target for link \[$link\]:\t does not exist\n"; }elsif (-l "$THISDIR$link" && -e $rc){ print "Target for link \[$link\]:\t $rc\n"; }else{ print "File \[$link\] found in links directory\n"; } }
In reply to Re: Re: verifying symbolic links
by eLore
in thread verifying symbolic links
by eLore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |