[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.
This commit is contained in:
Marty Oehme 2020-05-08 12:07:23 +02:00
parent 1f25f86290
commit 4681156a89
No known key found for this signature in database
GPG Key ID: 0CCB0526EFB9611A
1 changed files with 7 additions and 0 deletions

7
bibtex/.local/bin/bib_due Executable file
View File

@ -0,0 +1,7 @@
#!/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