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