From: Francois Fleuret Date: Sat, 17 Jun 2017 10:48:07 +0000 (+0200) Subject: Figure out a bibtex entry from a arxiv url or number. X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=commitdiff_plain;h=fe32c67f02646ec69ffd440ef8ac26b04181e413 Figure out a bibtex entry from a arxiv url or number. --- 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 '