Thanks to everyone who helped! I got the script to work, especially
tanks to Larry. The results can be found at:
http://www.tarogue.net/~tom/pictures/

The final script itself follows:

< --- Begin My Script --- >
#!/bin/bash

# Set counter for thumbnail-naming
COUNT=1

# If the output file already exists, then it (and the thumbnails already
# created need to be renamed or moved
if [ -f thumbnails.html ]
then
   echo "thumbnails.html exists. quitting."
else

# Clear the temp file for a fresh run
   if [ -f tn.temp ]
   then
      rm tn.temp
   fi

# Create the base web-page
   touch thumbnails.html
   echo "<html>" >> thumbnails.html
   echo "<head>" >> thumbnails.html
   echo "<title>Thumbnails</title>" >> thumbnails.html
   echo "</head>" >> thumbnails.html
   echo "<body>" >> thumbnails.html

# Make me some thumbnails!
   for DIRECTORY in "$@"; do
      echo $DIRECTORY
      ls $DIRECTORY/*.jpg >> tn.temp
   done
   while read LS
   do
      file=$LS
      if [ $COUNT -lt 10 ]
      then
         convert -size 75 $file tn-0$COUNT.jpg
      else
         convert -size 75 $file tn-$COUNT.jpg
      fi
# Un-comment for de-bugging
      # echo $file
      # sleep 1
      if [ $COUNT -lt 10 ]
      then
         echo "<a href=\"$file\"><img src=\"tn-0$COUNT.jpg\" alt=\"$file\"></a>" >> 
temp.html
      else
         echo "<a href=\"$file\"><img src=\"tn-$COUNT.jpg\" alt=\"$file\"></a>" >> 
temp.html
      fi
      COUNT=`expr $COUNT + 1`
   done < tn.temp
   rm tn.temp
sort temp.html >> thumbnails.html
rm temp.html

# Finish up the web-page and quit
   echo "</body>" >> thumbnails.html
   echo "</html>" >> thumbnails.html
fi

### Created Tue Jan 23 2001 by TARogue
### Thanks to the members of the Greater New Hampshire Linux Users
### Groups mailing list for all their help!
< ---- End My Script ---- >

-- 
Thomas M. Albright
Albright Enterprises - "The Small Business Solution"
http://www.albrightent.com/


**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to