From: Francois Fleuret Date: Mon, 12 Jun 2017 07:55:25 +0000 (+0200) Subject: Initial commit. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=c4d6a634221e8835fc27e3f0f3aded2d7a49a9fd;p=scripts.git Initial commit. --- diff --git a/arxiv-bib.sh b/arxiv-bib.sh new file mode 100755 index 0000000..3654b3b --- /dev/null +++ b/arxiv-bib.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +######################################################################### +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the version 3 of the GNU General Public License # +# as published by the Free Software Foundation. # +# # +# This program is distributed in the hope that it will be useful, but # +# WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # +# General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +# Written by and Copyright (C) Francois Fleuret # +# Contact for comments & bug reports # +######################################################################### + + +set -e +set -o pipefail + +tmp=$(mktemp /tmp/arxiv-bib.sh.XXXXXX) + +curl > "${tmp}" "https://arxiv.org/abs/$1" + +AUTHORS="" + +while read line +do + [[ "${AUTHORS}" ]] && AUTHORS="${AUTHORS} and " + AUTHORS="${AUTHORS}${line}" +done < <(grep '