#!/bin/sh
# Find duplicate @string{...} definitions and duplicate citation keys
# in one or more BibTeX .bib files.
#
# Usage:
#	bibdup bibfiles
#
# or
#	bibdup <infile
#
# [08-May-1999] -- update for bibparse 1.04 release
# [16-Jan-1993]

prefix=/usr/pkg
exec_prefix=${prefix}
LIBDIR=${prefix}/share/lib/bibdup
BINDIR=${exec_prefix}/bin

if test ! -d $LIBDIR
then
	LIBDIR=.
fi

if test ! -f $LIBDIR/bibdup.awk
then
	echo Cannot locate library file $LIBDIR/bibdup.awk
	exit 1
fi

# NB: Use regexp notation with tr so it works with both System V and
# BSD style tr!
$BINDIR/biblex $* | tr '[A-Z]' '[a-z]' | /usr/bin/awk -f $LIBDIR/bibdup.awk 
