3 # Very ugly but handy stuff: loops through the bibtex keys provided as
4 # arguments, and for each grabs the first bib entry that matches in
5 # all the found bib files.
7 tmp=$(mktemp /tmp/getbib.XXXXXX)
12 find -type f -name "*.bib" | while read f && [[ ! -s "${tmp}" ]]
14 sed -n '/^[ \t]*@[^{]*{'$1'/,/^[ \t]*}/p' "${f}" > "${tmp}"