From eaf4c12ee2647a2c4cbca5f3aed63a04ddf0e097 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 26 Oct 2022 16:28:38 -0400 Subject: [PATCH] fix #1219 --- .local/bin/getbib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/getbib b/.local/bin/getbib index bedc256..121dd6e 100755 --- a/.local/bin/getbib +++ b/.local/bin/getbib @@ -4,7 +4,7 @@ if [ -f "$1" ]; then # Try to get DOI from pdfinfo or pdftotext output. doi=$(pdfinfo "$1" | grep -io "doi:.*") || - doi=$(pdftotext "$1" 2>/dev/null - | grep -io "doi:\s*\S\+[[:alnum:]]" -m 1) || + doi=$(pdftotext "$1" 2>/dev/null - | sed -n '/[dD][oO][iI]:/{s/.*[dD][oO][iI]:\s*\(\S\+[[:alnum:]]\).*/\1/p;q}') || exit 1 else doi="$1"