For Programmers: Free Programming Magazines  


Home > Archive > LibWWW > March 2006 > wget in scripts









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author wget in scripts
Malcolm Mill

2006-03-07, 7:22 pm

Hi,
Can anyone help me with this.

I'm using wget, a perl script and a shell script to download files
from serveral directories on a web server.

The URLs I'm passing to wget are of the form:

http://www.foo.br/001/ - http://www.foo.br/050/

My perl script loops through the numbers 1-50, inserting each
iteration in a string representing the URL. I call it from my shell
script and redirect output to a text file. I then call wget from the
same shell script passing the name of this text file to wget's
--input-file option.

I want to do this all in Perl and avoid messing around with shell
scripts or batch files.

Also, is there a simple way of constructing the numbers 001-050 for my
URL strings?

I don't like what I'm doing at the moment which is....

$max = 51;
$zero = "0";
$zerozero = "00"

for ($i=1; $i<10; $i++) {
print "$zerozero$i\n";
}
for ($i=10; $i<$max; $i++) {
print "$zero$i\n";
}

Cheers,

Malcolm
________________________________________
_______
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

________________________________________
_______
Perl.NET mailing list
Perl.NET@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com