From: François Fleuret Date: Mon, 21 Nov 2022 07:21:54 +0000 (+0100) Subject: Update. X-Git-Url: https://ant.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=scripts.git Update. --- diff --git a/arxiv.sh b/arxiv.sh index 1cc408a..556b403 100755 --- a/arxiv.sh +++ b/arxiv.sh @@ -29,10 +29,11 @@ tmp=$(mktemp /tmp/arxiv-bib.sh.XXXXXX) while [[ "$1" ]] do - if [[ $1 =~ ^http ]] || [[ $1 =~ ^[0-9\.]*$ ]] + if [[ $1 =~ ^http ]] || [[ $1 =~ ^[0-9v\.]*$ ]] then - id="$(echo "$1" | sed -e 's|^.*/\([0-9.]*\)$|\1|')" - wget "https://arxiv.org/pdf/${id}" + id="$(echo "$1" | sed -e 's|^.*/\([0-9v.]*\)$|\1|' | sed -e 's/v[0-9]*$//')" + wget -U "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1" "https://arxiv.org/pdf/${id}" + mv "${id}" "${id}.pdf" filename="${id}.pdf" else filename="$1" @@ -112,7 +113,8 @@ EOF AUTHORS="${FIRST_AUTHOR} et al" fi - TITLE="$(echo "${AUTHORS} - ${TITLE} ${YEAR} ${id}.pdf" | sed -e 's/ /_/g')" + #TITLE="$(echo "${AUTHORS} - ${TITLE} ${YEAR} ${id}.pdf" | sed -e 's/ /_/g')" + TITLE="$(echo "${AUTHORS} - ${TITLE} ${YEAR} ${id}.pdf" | sed -e 's/[^-a-zA-Z0-9_\.\/]/_/g' | sed -e 's/__*/_/g')" mv -v "${filename}" "${ARXIV_BIBDIR}/${TITLE}" @@ -122,4 +124,4 @@ EOF done -rm -rf ${tmp} +#rm -rf ${tmp} diff --git a/kill-unused-xterms.sh b/kill-unused-xterms.sh index 075b2ba..8100b6b 100755 --- a/kill-unused-xterms.sh +++ b/kill-unused-xterms.sh @@ -21,12 +21,15 @@ set -e +TERMINAL_APP=xterm +[[ "${TERMINAL_APP}" ]] || TERMINAL_APP=xterm + NB_KILLED=0 NB_TOTAL=0 SHELL_NAME=$(basename ${SHELL}) # Loop through the pid of xterms -for ppid in $(ps h -C xterm -o pid); do +for ppid in $(ps h -C "${TERMINAL_APP}" -o pid); do N=0