checkbib.sh
public shellscript v1 · immutable#!/bin/bashBIBFILE=references.bibAUXFILE=report.auxPAGER=lessTEMPAUX=$(mktemp)TEMPBIB=$(mktemp)echo "AUX: $AUXFILE => $TEMPAUX"egrep '^\\citation' $AUXFILE|sort|uniq|perl -ne 's#\\citation{(.*)}#$1#; print;' > $TEMPAUXecho "BIB: $BIBFILE => $TEMPBIB"egrep '^@' $BIBFILE|sort|uniq|perl -ne 's#\@\S+\s*{\s*(\S+)\s*,#$1#; print;' > $TEMPBIBecho "Comparing AUX with BIB (bib on the right). Using $PAGER pager."echo "Press ENTER when ready."readdiff -y $TEMPAUX $TEMPBIB | $PAGER