Download enumerated files

Shell scripting is nothing that I can do well yet. That’s why I thought to start a new topic on my blog.

I often download enumerated PDF files. Before I’ve automated this job I downloaded the files by changing the URL manually in the browser. I could use an enumerated file downloader like this one1 but I want to learn scripting so I do the same job using the shell.

What do we need? A loop of course. This increments the postfix number of the files. Then we also need a command which actually downloads the resources. For this I use wget. And here’s the result, a one line script:


for (( i=1; i<=14; i++)) do wget www.example.com/path_to_the_files/file$i.pdf; done

If you don't script much you should take a look at the manual page of bash (or the shell you use). The website Linux Shell Scripting Tutorial is also a good place to look up things.

Maybe you have to download enumerated files too. Just copy the line, paste it in your shell and change the start and stop parameter of the counter and the resource of course ;-)

I think to use the shell everytime I want to download enumerated files will suck. So the next step is to write a firefox plugin 2.

  1. I know this app is for Windows but I'm sure there are also some for Mac.
  2. Maybe there's already something but I haven't written a firefox add-on yet what I should try.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>