22 lines
324 B
Bash
Executable File
22 lines
324 B
Bash
Executable File
#!/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
|