#!/bin/sh -x
# take a server list and isbn list
#ILIST="$HOME/bookserv/zlist/gate-z39-output"
ILIST="gate-z39-pruned"

grep -v SKIP $ILIST | while read host db; do
    echo "======== HOST: $host  DB: $db ========"
    for ISBN in $(cd unknown > /dev/null; echo *); do
	echo "====== ISBN: $ISBN ======"
	RAW="rawmarc/${ISBN}.marc"
	test -s ${RAW} || yaz-get-any ${ISBN} ${host} ${db}
	test -s ${RAW} && rm unknown/${ISBN}
	test -s ${RAW} && touch useful/${host}+${db}
	test -s ${RAW} && (echo ${host} ${db} > rawmarc/${ISBN}.whence)
    done    
done
