#!/bin/sh # # This will generate lines of HTML code appropriate for using thumbnail # images (named a-small.b) to link to full-sized images (named a.b) # # Redirect stdout to a file to save the generated code. while [ $# -gt 0 ]; do case "$1" in *-small.* ) file $1 1>&2 ext=`echo $1 | awk 'BEGIN{FS="."}{print $NF}'` thumbext="-small.$ext" full=`basename $1 $thumbext`.$ext echo "$full" ;; * ) echo "ignoring $1" 1>&2 ;; esac shift done exit