#!/usr/bin/perl # Take a list of images, and find which of them are unreferenced by files in the current directory $i=0; while ($ARGV[$i]){ $img = $ARGV[$i]; if(!`grep -rlqI $img *`){ print "$img "; } $i++; }