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

[ale] Bash (or whatever) question



On Tue, 15 Feb 2005 22:34:26 -0500 (EST), John Mills
<johnmills at speakeasy.net> wrote:
> ALErs -
> 
> Should be simple, but I don't see it:
> 
> I have a directory with softlinks to a number of files that no longer
> exist, along with links to files that _do_ exist.
> 
> How can I selectively list those links which are _not_ satisfied, so I can
> remove them at one go, while ignoring those for which the linked files
> still exist?

This little script worked for me in a quick test:

for ii in *; do if [ -e $ii ]; then echo $ii exists; else echo $ii is
a broken link; fi; done

Michael