#!/bin/sh

bibdep() {
	if [ -f $1 ] ; then
		LIST=`grep '^\\\\bibliography{' $1 | sed 's#^\\\\bibliography{\([^}]\+\)}.*#\1.bbl#g'`
		for i in $LIST ; do echo $i ; done
	fi
}

TEXFILE="$1"
shift
echo "$*: " `bibdep "$TEXFILE"`
