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?a=commitdiff_plain;ds=sidebyside;h=fe32c67f02646ec69ffd440ef8ac26b04181e413;hp=2c923caa06d15b1c4de9696908108365fb2bc0e3;p=scripts.git 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 '