# bib-ls.awk - list database entries # # Requires bib-parse.awk and bib-canon.awk. Variables (set with -v): # long - 0: print one key per line # 1: print key, type, author, year and title, tab-separated function bib_pass(raw) { } function bib_entry(type, key, a, t) { if (long + 0 == 0) { print key return } a = bib_get("author") if (a == "") a = bib_get("editor") gsub(/[{}]/, "", a) gsub(/[ \t\r\n]+/, " ", a) if (match(a, / [Aa][Nn][Dd] /)) a = substr(a, 1, RSTART - 1) " et al." t = bib_get("title") gsub(/[{}]/, "", t) gsub(/[ \t\r\n]+/, " ", t) printf "%s\t%s\t%s\t%s\t%s\n", key, type, a, bib_get("year"), t }