#!/usr/local/bin/bash
#
# creates simple index of pictures from a directory
# (well, it used to be simple)
#
# Eric Thern, Nov 2001
#
# VARIABLES
#
# directory containing pictures
pictures=mineralogy
# output html file
s=index.html
# sections file
# in " number=section " format
# file contents:
# 1=color
# 2=cleavage
# 3=deformation
# 4=fracture
# 5=fusibility
# 6=habit
# 7=hardness
# 8=luster
# 9=other
# 10=structure
sections=sections
#
# HEADER
#
echo "" > $s
echo "" >> $s
echo "
" >> $s
echo "Mineralogy Specimen Pictures, Grouped by Properties" >> $s
echo "" >> $s
echo "" >> $s
echo "" >> $s
echo " Mineral Study Guide
" >> $s
echo " Warning:
" >> $s
echo " This doesn't include all the specimens in lab, some photos didn't come out right, and some were so horrible that I deleted them.
" >> $s
echo "
Please email any corrections to Eric Thern, there are most likely a bunch of spelling errors or other mistakes.
here is the script that made this site
" >> $s
echo "
" >> $s
echo "Sections:
" >> $s
echo "
" >> $s
#
# INITIAL SECTIONS
#
for (( count=1; $count < 11; count=$count+1 ));
do
g1=`grep "$count=" $sections | awk -F= '{ print $2 }'`
echo $count
echo $g1
echo "$g1
" >> $s
echo "$g1$g1 section
back to the index
Minerals are shown in following order:
mineral-property-type-[value-of-property] ----- name of mineral (variant) OTHER NOTES [PICTURE]
" > $g1.html
for i in `ls -1 $pictures | grep $g1-`; do echo -e "`echo $i | awk -F] '{ print $1 \"]\" }'` ----- " >> $g1.html; echo -e "`echo $i | awk -F] '{ print $2 }' | awk -F. '{print $1}' | awk -F- '{print $2 \" \" $3 \" \" $4 \" \" $5 \" \" $6 \" \" $7}'` " >> $g1.html; echo "[PICTURE]
" >> $g1.html; done
echo -e "
Mineral Specimens from SUNY Potsdam Geology Dept.
Page created by Eric Thern, November 2001
last update: `date`" >> $g1.html; done
#
# FULL-LISTING SECTION
#
echo "
" >> $s
echo "full-listing
" >> $s
echo "full-listingfull-listing section
back to the index
Minerals are shown in following order:
mineral-property-type-[value-of-property] ----- name of mineral (variant) OTHER NOTES [PICTURE]
" > full-listing.html
for i in `ls -1 mineralogy`; do echo -e "`echo $i | awk -F] '{ print $1 \"]\" }'` ----- " >> full-listing.html; echo -e "`echo $i | awk -F] '{ print $2 }' | awk -F. '{print $1}' | awk -F- '{print $2 \" \" $3 \" \" $4 \" \" $5 \" \" $6 \" \" $7}'` " >> full-listing.html; echo "[PICTURE]
" >> full-listing.html; done
echo -e "
Mineral Specimens from SUNY Potsdam Geology Dept.
Page created by Eric Thern, November 2001
last update: `date`" >> full-listing.html
#
# FOOTER
#
echo "
" >> $s
echo " Mineral Specimens from SUNY Potsdam Geology Dept." >> $s
echo "
" >> $s
echo " Page created by Eric Thern, November 2001
last update: `date`" >> $s
#
# END
#
echo "" >> $s
echo "" >> $s
echo "" >> $s