.\" lookbibtex.1 .TH LOOKBIBTEX 1 " 5 September 1991" .SH NAME lookbibtex \- find references in a bibtex database .SH SYNOPSIS .B lookbibtex [ \-s ] [ \-f .I field ] .I regexp [ .I bibfiles... ] .SH DESCRIPTION lookbibtex searches through bibtex databases, printing entries that match .I regexp. See .BR bibtex (1) for a description of bibtex databases. .I Regexp is a Perl regular expression. See .BR perl (1) for an explanation of differences between perl and standard regular expressions. The \-s option passes @string defintions through. By default, they're eaten. Searches can be limited to particular bibtex fields with the \-f option. If no .I bibfiles are specified, all bibtex files in the path .SM BIBINPUTS are used. A \- for .I bibfiles reads a bibtex database from standard input. To do "and" searches on two fields use shell pipes, reading the output of one search as the bibliography of the second (using .RB ` \- ' for .I bibfiles in a pipeline). For example, to find what someone named Kafka wrote about emacs keyboard layout, do: .IP .B lookbibtex \-f author kafka | lookbibtex \-f title meta \- .LP To do "or" searches, use regular expressions. For example, you could be concerned with only careful authors, like Kunth and Kafka: .IP .B lookbibtex \-f author 'kunth\||\|kafka' .LP More sophisticated searches can be achieved by combining these techniques. .SH AUTHOR John Heidemann .SH "ENVIRONMENT VARIABLES" .TP .SM BIBINPUTS The path .SM BIBINPUTS is searched for .B .bib files if none are given on the command line. See .BR TeX (1) for a description of the path format. .SH SEE ALSO .BR bibtex (1), .BR bibdestringify (1), .BR perl (1). .SH BUGS .B Lookbibtex is written in Perl, so it will not run on machines which do not have perl installed (although this arguably a bug of the person too lazy to install such a useful tool). Multiple bibtex fields on one line will be missed. There should be a way of switching off the file name prefixing when searching multiple files. For now, simply .I cat the files into .IR lookbib . This program does not implement a full bibtex parser, just a good approximation. Because of this, it may fail on unusual bibtex files. In particular, the @ that begins a bibtex entry, and the } which end it must be the first non-whitespace character on their line, or they will be missed. Also, multi-line fields surrounded with double quotes or curley brackets are handled correctly, but ugly combinations of quotes and brackets and backslashed versions of the same may fail. Umlaut accents are removed from the search string. I make no predictions as to how this program will react to bibtex files with syntax errors.