how to generate an image only html file in bash

Technomage technomage.hawke at gmail.com
Fri Jul 16 18:59:36 MST 2010


here's what I'd like to do:
1. create individual html files for each picture (number not important)
2. have each html file display the current image with an href to the 
next in order image in the directory
3. have the first html file linked from inside index.html (such that it 
shows the first image)
4. when the last image in the directory  is reached, that html file has 
an href that refers to that current image

can I get a little help here? the bash scripting tutorials are lacking 
on some points.
now, what I have is very incomplete and I am not sure how to proceed here:

****** bash script  *******
#!/bin/bash
#create the index.html file with the type, header and title
touch index.html
echo "Content-type: text/html" >> index.html
echo "" >> index.html
echo "<html><head><title>picture display shell 
script</title></head><body>" >> index.html

# read the directory with the picture files
for i in *.jpg
     do
# this is the part I need to fill in (vreate the individual html files 
from each listed jpg image
# write those files, then create the finished index.html that links in 
the first file.

done
# close html file body and final type tag
echo "</body><html>" >> index.html


More information about the PLUG-discuss mailing list