box-o-sand/algs4/download-others

22 lines
324 B
Plaintext
Raw Normal View History

#!/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