dotfiles/bibtex/.local/bin/bib_due
Marty Oehme 4681156a89
[script] Add simple due script for bibtex file
Scrapes a bibtex file for 'due' field, and outputs all found entries
with their priority and sorted for date.
2020-05-16 17:35:34 +02:00

7 lines
320 B
Bash
Executable file

#!/usr/bin/env sh
# shows due entries of bibtex file passed in
# HACK: brittle and hacky!
#
# looks for 'due' entries in bibfile and gets their
awk '/due|^@\w|prio[123]/' ORS=' ' "$1" | sed -E 's/ (@\w)/\n\1/g' | grep due | sed 's/ //g' | sed -E 's/^@\w+\{(\w+),due=\{(.+?)\},.*,priority=\{(\w)+\}.*$/\2 \3 \1/' | sort