#!/bin/sh # Copyright for the Uniform Repository Service (c) 1995, 1996, 1997, # by Gerald Banon. All rights reserved. # Version 1.1 # lookup_index (li) umask 2 set `echo ../../../../..`; col=$1 cd .. # level 0 from not_sent if test ! -d library_service then echo "" echo improper current directory echo "" echo The current directory must be library_service. echo "" exit fi if test -d .t then echo "" echo You are requesting a new process from the library service ls -ld .t | awk \ '{ printf "but there is an old one, requested by %s,\n", $3 }' echo which is still running or terminates abnormally. echo "" echo Do you want to cancel the old process? echo \(answer yes or no, default is no\) read answer echo $answer | sed 's/$/n/' | \ awk '{ printf "%s\n", substr($1,1,1) }' >.t1 set `cat .t1`; a=$1 if test $a = y then rm -r .t rm .t1 else rm .t1 exit fi fi mkdir .t ls -d $col/*/*/*/*/bib/Librarian==LoCoIn >.t/z1 2>.t/z2 if test -s .t/z1 then cat .t/z1 | \ awk -F/ '{ printf "%s %s/%s/%s/%s\n", NR, $6, $7, $8, $9 }' >.t/z2 cat .t/z1 | \ awk -F/ \ '{ printf "'$col'/%s/%s/%s/%s/doc/@reference.bib\n", $6, $7, $8, $9 }' | \ sed 's/^/cat /' | sed 's/$/ | grep "^@" | wc -l >>.t\/z4/' >.t/z3 rm -f .t/z4 chmod +x .t/z3 .t/z3 # cat grep wc cat .t/z2 | awk 'l < length($0) { l = length($0) } END { print l }' >.t/ml cat .t/z4 | awk 'l < length($0) { l = length($0) } END { print l }' >>.t/ml cat .t/ml | awk '{ l += $1 } END { print l + 40 }' >.t/mtl # 40 was based on tests pr -m -t -w`cat .t/mtl` .t/z2 .t/z4 | \ awk 'length($0) >= 2 { print $0 }' | \ awk '{ printf "%s %s \t%s\n", $1, $2, $3 }' >.t/l1 echo "" echo Which index do you want to look over? echo cat .t/l1 echo "" echo \(answer by entering the repository number printed \ in the first echo column\; the last column indicates the number of \ entries\) echo "" read answer cat .t/l1 | sed -n '/^'$answer' /p' >.t/l2 if test ! -s .t/l2 then echo "" echo wrong repository number echo "" rm -r .t exit fi fi rp=`cat .t/l2 | awk '{ print $2 }'` rm -f $col/$rp/not_sent/f_* # migration (7/7/97) cat $col/$rp/doc/@reference.bib | \ sed 's/]*>// s/<\/A>//' >$col/$rp/not_sent/@reference2.bib if test ! -f $col/$rp/not_sent/@reference2.bix then ../../../../../../col/dpi.inpe.br/banon/1995/09.21.16.26/\ doc/bibindex \ $col/$rp/not_sent/@reference2.bib >.t/x2 fi ls -t \ $col/$rp/not_sent/@reference2.bi? | sed '$d' | \ sed 's/^.*\/@reference2.bi//' >.t/x3 if test `cat .t/x3` = b then ../../../../../../col/dpi.inpe.br/banon/1995/09.21.16.26/\ doc/bibindex $col/$rp/not_sent/@reference2.bib >.t/x4 fi rm -r .t ../../../../../../col/dpi.inpe.br/banon/1995/09.21.16.26/\ doc/biblook $col/$rp/not_sent/@reference2.bib