#!/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" 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/ "$bookid/$pgname.jpg" if test $? -ne 0; then echo "Error downloading page id $i (number ${pgnum}): $pgurl" rm -f "$bookid/$pgname.jpg" fi done