Skip to content

Instantly share code, notes, and snippets.

@yaotti
Created February 5, 2009 17:08
Show Gist options
  • Save yaotti/58840 to your computer and use it in GitHub Desktop.
Save yaotti/58840 to your computer and use it in GitHub Desktop.
downloading pdf files at UVa
#!/bin/zsh
# UVa pdf files download script
# http://icpcres.ecs.baylor.edu/onlinejudge/
start=${1:-101} # 最初の問題
num=${2:-1} # ダウンロードしたい問題数(省略時は1つ)
cdir=$(pwd)
savedir=${3:-.}
vol=$(( $start / 100 ))
while [ $num -gt 0 ]
do
cd $savedir # 保存したいディレクトリ
wget -nd http://icpcres.ecs.baylor.edu/onlinejudge/external/$vol/$start.pdf
num=$(($num-1))
start=$(($start+1))
done
cd $cdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment