#!/bin/bash if [ $# != 3 ] ; then echo "Usage: ./COMPX520-RUN-MIDDLE-PNG-hi-res.sh doc_id page location" 1>&2 exit 1 fi doc_id=$1 page_num=$2 location=$3 doc_id_file=`echo $doc_id | sed 's/:/+/' | sed 's/\//=/g'` output_file="hires-middle-download-images/$location/$doc_id_file-$page_num.png" echo "Retrieving doc-id-page: $doc_id-$page_num -> $output_file" echo "" ./dapiclient2-extended-hi-res.pl "$doc_id/$page_num" > "$output_file"