#!/bin/sh usage="Usage: $0 eraraurl eraraurl: The book index page, e.g. https://www.e-rara.ch/zut/doi/10.3931/e-rara-10416 Downloads all pages from a book on e-rara.com, saving them to the current directory. " test $# -ne 1 && echo "$usage" && exit 1 bookindex=`curl -s -f "$1"` if test $? -ne 0; then echo "Error downloading book index page: $1" exit 1 fi iiifpath=`echo "$bookindex" | sed 's/ "${pgname}.jpg" if test $? -ne 0; then echo "Error downloading page id $i (number ${pgnum}): $pgurl" rm -f "${pgname}.jpg" fi done