From 4681156a8987a3bbaff3998c67ff77d234acfeb7 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 8 May 2020 12:07:23 +0200 Subject: [PATCH] [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. --- bibtex/.local/bin/bib_due | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 bibtex/.local/bin/bib_due diff --git a/bibtex/.local/bin/bib_due b/bibtex/.local/bin/bib_due new file mode 100755 index 0000000..aed3530 --- /dev/null +++ b/bibtex/.local/bin/bib_due @@ -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