Skip to content

Instantly share code, notes, and snippets.

@coandco
Created April 25, 2014 19:08
Show Gist options
  • Save coandco/11299845 to your computer and use it in GitHub Desktop.
Save coandco/11299845 to your computer and use it in GitHub Desktop.
#!/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