#!/bin/ksh chmod +w * chmod +r * #chgrp botany * PATH=$PATH:/usr/local/bin/pbmplus10dec91/bin #for file in *.jpg #do # output=`echo $file | sed -e 's/.jpg/.gifs/'` # if [ ! -a $output ] # then # echo "doing $file, outputting to $output" # djpeg -P $file | # pnmscale -xysize 120 120 | # ppmquant 256 | # ppmtogif > $output # fi #done #for file in *.gif #do # output=`echo $file | sed -e 's/.gif/.gifs/'` # if [ ! -a $output ] then # echo "doing $file, outputting to $output" # giftoppm $file | # pnmscale -xysize 120 120 | # ppmquant 256 | # ppmtogif > $output # fi #done for descfile in DESC* #for descfile in DESC10 do cat $descfile | mawk ' BEGIN { printed = 1; images = 0; for (element in image) { delete image[element] delete desc[element] } } /^[ ]*\#/ { # comment line next; } /^IMAGE:/ { sub("^IMAGE:[ ]*","",$0); sub("[ ]*$","",$0); image[++images] = $0; next; } /^PUB:/ { sub("^PUB:[ ]*","",$0); pub = $0; issue=""; date=""; page=""; next; } /^ISSUE:/ { sub("^ISSUE:[ ]*","",$0); issue = $0; next; } /^DATE:/ { sub("^DATE:[ ]*","",$0); date = $0 next; } /^PAGE:/ { sub("^PAGE:[ ]*","",$0); page = $0 next; } /^NAME:/ { sub("^NAME:[ ]*","",$0); printed = 0; name = $0 next; } /^DESC:/ { sub("^DESC:[ ]*","",$0); desc[images] = $0; next; } /^CREDIT:/ { sub("^CREDIT:[ ]*","",$0); credit = $0 next; } /^TEXT:/ { intext++; text = "true" next; } /^\}$/ { intext=0; next; } /^$/ { if (intext) { print "
blank line in text block!" } else if (!printed) { file = image[1] sub(".gif",".html",file); sub(".jpg",".html",file); printed++; print "
" >> file close("temp.process") while ((c = getline < "temp.process") != 0 && c!=-1) { print $0 >> file } print "
" >> file system("rm -f temp.process") } if (credit != "" || pub != "" || issue != "" || date != "" || name != "" || page != "") { print "
" >> file } print "" >> file text="" images = 0; for (element in image) { delete image[element] delete desc[element] } close(file); } next; } // { if (intext) { text = "true" print >> "temp.process" } else { ; } next; } ' done rm -f "temp.process" #shar -bcv *.gifs *.html *.jpg > sharfile