Re: wget in scripts

Andy Armstrong <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
On 8 Nov 2004, at 05:44, Malcolm Mill wrote:
> 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?

$ perl -e 'system sprintf("wget http://www.for.br/%03d/", $_) for  
(1..50);'


-- 
Andy Armstrong, hexten.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.