8.21.2005

Image gallery script


Here's a quick script I just wrote that will make an HTML page called "gallery.htm" that shows all images in a directory. Nothing fancy, but it does exactly what I want it to do. Maybe someone out there will find a use for it too
#! /bin/sh
dir=`pwd`
touch gallery.htm
echo '<html>' >> gallery.htm
echo '<head>' >> gallery.htm
echo '<title>'$dir Image Gallery'</title>' >> gallery.htm
echo '</head>' >> gallery.htm
echo '<body>' >> gallery.htm

echo "Gimme a title"
read title
echo '<center><H1>'$title'</H1></center>' >> gallery.htm
echo '<br>' >> gallery.htm
echo '<br>' >> gallery.htm


for filename in *.jpg
do
echo '<center>''<img width=785 height=589 src="'"$filename"\"\>'</center>' >> gallery.htm
echo '<br>' >> gallery.htm
echo '<br>' >> gallery.htm
echo '<br>' >> gallery.htm
done

echo '</html>' >> gallery.htm
echo '</body>' >> gallery.htm



<< Home

This page is powered by Blogger. Isn't yours?