Created
April 25, 2014 19:08
-
-
Save coandco/11299845 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# When run in a directory with no .jpg files, | |
# or in a directory containing the first n JL8 | |
# strips, this will download the remaining strips | |
echo "JL8:" | |
i=`ls *.jpg | wc -l` | |
while true; | |
do | |
i=$(($i+1)) | |
if [ $i -ge 10000 ]; then | |
break | |
fi | |
padded=`printf "%.3d" $i` | |
result=`wget "http://limbero.org/jl8/comics/$i.jpeg" -O "jl8$padded.jpg" 2>&1 | grep "404 Not Found"` | |
if [ "$result" != "" ] | |
then | |
rm jl8$padded.jpg | |
break | |
fi | |
echo "$padded" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment