Skip to content

Instantly share code, notes, and snippets.

@papajuans
Created February 2, 2009 22:23
Show Gist options
  • Save papajuans/57137 to your computer and use it in GitHub Desktop.
Save papajuans/57137 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Declare array
declare -a ARRAY
#Open file for reading to array
exec 10<urls.txt
let count=0
while read LINE <&10; do
url=$LINE
hiturl="http://localhost:8000${LINE}"
filename=${url//\//-}
filename=${filename/#-/}
filename=${filename/%-/}
echo $filename
echo $hiturl
curl $url -o $filename.html
done
exec 10>&-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment