Created
February 5, 2009 17:08
-
-
Save yaotti/58840 to your computer and use it in GitHub Desktop.
downloading pdf files at UVa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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