I want to download a series of files say 150 files whose download links are similar but they vary only by a number. That is, the general download link is:
http://www.example.com/content/download_content.php?content_id=#
where # is a number b/w 1 and 150.
Which of the following works best? Share your suggestions too.. :) Suggest some code in other languages as I'm not that good in linux.. But if linux is good for this kinda stuff, it's alright.. Please give me a brief explanation for how to execute these bash codes. Thanks...
for i in `seq 1 150` ; do wget "http://www.example.com/content/download_content.php?content_id=$i" -O $i.html ; done
curl -O http://www.example.com/content/download_content.php?content_id=#[1-150]
#!/bin/sh
i=1
while [ $i -le 150 ]; do
wget -O $i.out "http://www.example.com/content/download_content.php?content_id=$i"
i = $((i + 1))
done