Archiving a bunch of old stuff
This commit is contained in:
21
oldstuff/algs4/download-others
Executable file
21
oldstuff/algs4/download-others
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
OTHERS="$(cat others.txt)"
|
||||
|
||||
cd src/java
|
||||
|
||||
for other in $OTHERS
|
||||
do
|
||||
if [ ! -f "$other" ]
|
||||
then
|
||||
dn=$(dirname "$other")
|
||||
mkdir -p "$dn"
|
||||
pushd "$dn"
|
||||
curl -O "http://algs4.cs.princeton.edu/${other}"
|
||||
chmod 444 "$(basename "$other")"
|
||||
popd
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user