--- /dev/null
+#!/bin/bash
+
+# Very ugly but handy stuff: loops through the bibtex keys provided as
+# arguments, and for each grabs the first bib entry that matches in
+# all the found bib files.
+
+tmp=$(mktemp /tmp/getbib.XXXXXX)
+
+while [[ "$1" ]]
+do
+ rm -f "${tmp}"
+ find -type f -name "*.bib" | while read f && [[ ! -s "${tmp}" ]]
+ do
+ sed -n '/^[ \t]*@[^{]*{'$1'/,/^[ \t]*}/p' "${f}" > "${tmp}"
+ done
+ cat "${tmp}"
+ echo
+ shift
+done
+
+rm -rf "${tmp}"