Downloading lots more stuff from algs4 book site
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user