#!/usr/bin/env zsh setopt extendedglob if [ -z "$1" -o ! -e "$1" ]; then cat<<-EOF Usage: $0 KML-mapfile.kml Checks jpeg files in the current directory are all specified in KML file, and all file name specifications in KML file point to existent file. EOF exit 0 fi for f in (#i)*.jp*g; do fgrep -q "$f" "$1" || echo "$f" not found in KML done egrep -i '\.jpe?g' "$1" \ | sed -e 's/[^>]*>//' -e 's/<.*//' | tr ';' '\n' \ | while read fn; do test -e "$fn" || echo $fn not found in this DIR done