#!/bin/sh # Program to call jpgnamer and jpgwrapper to rename and create an index.html # file. # 1st Argument on command line is the file prefix # 2nd Argument on command line is the starting number for the sequence # The pictures are renamed _xxx.jpg where xxx is the sequence number # files _xxx.html are also created # #If a parameter is given ($# >= 1), we accept it as the prefix if [ "$#" != "0" ]; then PREFIX=$1 else PREFIX="px" fi # #If a second parameter is given, we assume it is a count start number if [ $# -gt 1 ]; then LOOP=$2 else LOOP=1 fi # if [ `bash jpgnamer $PREFIX $LOOP > sedfile` ]; then exit 1 # Not OK else `bash jpgwrapper > index.html` exit 0 fi