From c4d6a634221e8835fc27e3f0f3aded2d7a49a9fd Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Mon, 12 Jun 2017 09:55:25 +0200 Subject: [PATCH] Initial commit. --- arxiv-bib.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 arxiv-bib.sh 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 '