[ale] Bash (or whatever) question

John Mills johnmills at speakeasy.net
Wed Feb 16 22:44:03 EST 2005


Michael, Geoffrey, and Fletch -

Thanks very much for the help.

On Wed, 16 Feb 2005, Geoffrey wrote:

> John Mills wrote:

> > 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?
 
> rm $(for fn in *; do
> test -f $fn || echo $fn
> done)

Very clean. Thanks - not only did I learn something new, now I better 
understand some things I was already doing without thinking about them!

 - John Mills
   john.m.mills at alum.mit.edu



More information about the Ale mailing list