#!/bin/sh rm -f book.djvu first=0 for file in $( ls *.jpg | sort -n ); do convert -enhance $file page.pbm cjb2 page.pbm page.djvu if [ $first = "0" ]; then echo Make start page $file cp page.djvu book.djvu first=1 else echo Add page $file to book.djvu djvm -i book.djvu page.djvu fi rm -f page.djvu page.pbm done