Downloading lots more stuff from algs4 book site

This commit is contained in:
Dan Buch
2013-01-20 14:05:01 -05:00
parent d834b81003
commit 150a3745f6
3 changed files with 143 additions and 18 deletions

View File

@@ -3,26 +3,19 @@
set -e
set -x
OTHERS="
11model/RightTriangle.java
11model/Tone.java
11model/Scale.java
11model/Binomial.java
11model/Wget.java
11model/largeT.txt
11model/largeW.txt
11model/tinyT.txt
11model/tinyW.txt
"
OTHERS="$(cat others.txt)"
cd src/java
for other in $OTHERS
do
bn=$(basename "$other")
if [ ! -f "$bn" ]
if [ ! -f "$other" ]
then
dn=$(dirname "$other")
mkdir -p "$dn"
pushd "$dn"
curl -O "http://algs4.cs.princeton.edu/${other}"
chmod 444 "$bn"
chmod 444 "$(basename "$other")"
popd
fi
done