#!/bin/sh # Copyright for the Uniform Repository Service (c) 1997, # by Gerald Banon. All rights reserved. # Version 1.1 # mirrorsearch pid=$$ col=../../../../.. serv=dpi.inpe.br/banon/1995/08.08.00.00 string=`echo $QUERY_STRING | sed 's/^q=//' | sed 's/+/ /g' | \ sed 's/%26/\&/g' | sed 's/%21/!/g' | sed 's/%7C/|/g' | sed "s/%27/'/g"` cd $PATH_INFO/col/$serv/not_sent # level 0 from not_sent mkdir .t$pid echo $string >.t$pid/ax echo s .t$pid/z2 >>.t$pid/ax echo q >>.t$pid/ax # rm -f $col/`cat .setenv/mirror_path`/not_sent/mirror.bib # ln $col/`cat .setenv/mirror_path`/doc/mirror.bib \ # $col/`cat .setenv/mirror_path`/not_sent/mirror.bib if test ! -f $col/`cat .setenv/mirror_path`/not_sent/mirror.bix then ../../../../../../col/dpi.inpe.br/banon/1995/09.21.16.26/\ doc/bibindex \ $col/`cat .setenv/mirror_path`/not_sent/mirror.bib >.t$pid/x2 fi ls -t $col/`cat .setenv/mirror_path`/not_sent/mirror.bi? | \ sed '$d' | \ sed 's/^.*not_sent\/mirror.bi//' >.t$pid/x3 if test `cat .t$pid/x3` = b then ../../../../../../col/dpi.inpe.br/banon/1995/09.21.16.26/\ doc/bibindex \ $col/`cat .setenv/mirror_path`/not_sent/mirror.bib >.t$pid/x4 fi cat .t$pid/ax | \ ../../../../../../col/dpi.inpe.br/banon/1995/09.21.16.26/\ doc/biblook $col/`cat .setenv/mirror_path`/not_sent/mirror.bib >.t$pid/z3 if test -s .t$pid/z2 then # search works cat .t$pid/z2 | sed '1,2d' >.t$pid/output else # search fails cat .t$pid/z3 | sed '1,2d' >.t$pid/output fi ll=`cat .setenv/library_location` # ll mp=`cat .setenv/mirror_path` # mp nb=`cat .t$pid/output | egrep '^@' | wc -l` # nb # Advertising if test -f @advertising.html then echo '

' >.t$pid/ad cat @advertising.html >>.t$pid/ad echo '


' >>.t$pid/ad else echo "" >.t$pid/ad fi # Advertising end cat <<% Content-Type: text/html URLib mirror search `cat .t$pid/ad` $string
$nb matching the query
`cat .t$pid/output`
% rm -r .t$pid