3 # Any copyright is dedicated to the Public Domain.
4 # https://creativecommons.org/publicdomain/zero/1.0/
6 # Written by Francois Fleuret <francois@fleuret.org>
8 # Very ugly but handy stuff: loops through the bibtex keys provided as
9 # arguments, and for each grabs the first bib entry that matches in
10 # all the found bib files.
12 tmp=$(mktemp /tmp/getbib.XXXXXX)
17 find -type f -name "*.bib" | while read f && [[ ! -s "${tmp}" ]]
19 sed -n '/^[ \t]*@[^{]*{'$1'/,/^[ \t]*}/p' "${f}" > "${tmp}"