From fe32c67f02646ec69ffd440ef8ac26b04181e413 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Sat, 17 Jun 2017 12:48:07 +0200 Subject: [PATCH] Figure out a bibtex entry from a arxiv url or number. --- arxiv-bib.sh | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/arxiv-bib.sh b/arxiv-bib.sh index 3654b3b..3097a79 100755 --- a/arxiv-bib.sh +++ b/arxiv-bib.sh @@ -23,28 +23,44 @@ set -o pipefail tmp=$(mktemp /tmp/arxiv-bib.sh.XXXXXX) -curl > "${tmp}" "https://arxiv.org/abs/$1" +while [[ "$1" ]] +do -AUTHORS="" + id="$1" -while read line -do - [[ "${AUTHORS}" ]] && AUTHORS="${AUTHORS} and " - AUTHORS="${AUTHORS}${line}" -done < <(grep ' "${tmp}" "https://arxiv.org/abs/${id}" + + AUTHORS="" + + while read line + do + [[ "${AUTHORS}" ]] && AUTHORS="${AUTHORS} and " + AUTHORS="${AUTHORS}${line}" + done < <(grep '