X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=blobdiff_plain;f=arxiv-rename-pdf.sh;fp=arxiv-rename-pdf.sh;h=b165c5e67df954ce4c436040f3b21c016c4c40c1;hp=57b80c5213d09fd68947e50a5ea0e6fda1c07da1;hb=bef43acb5354ea8114c98a22aeabf9e7338ec90e;hpb=750f872cb118f152b3cf7c1756486667e472aa18 diff --git a/arxiv-rename-pdf.sh b/arxiv-rename-pdf.sh index 57b80c5..b165c5e 100755 --- a/arxiv-rename-pdf.sh +++ b/arxiv-rename-pdf.sh @@ -31,17 +31,17 @@ do if [[ $1 =~ ^http ]] then - wget "$1" - id="$(echo "$1" | sed -e 's|^.*/\([^\]*\)$|\1|')" + id="$(echo "$1" | sed -e 's|^.*/\([0-9.]*\)$|\1|')" + wget "https://arxiv.org/pdf/${id}" filename="${id}.pdf" else filename="$1" id="$(basename ${filename} .pdf)" fi - while [[ -f "$1.part" ]] # dealing with firefox's download + while [[ -f "${id}.pdf.part" ]] # dealing with firefox's download do - echo "Waiting for $1.part to vanish" + echo "Waiting for ${id}.pdf.part to vanish" sleep 1 done