cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-users Mailing List Archives

Re: -O option

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 6 Dec 2001 15:38:45 +0100 (MET)

On 4 Dec 2001, Jason Mancini wrote:

> Say you have a list of FTP addresses to download in a file named
> "ftp-list.txt".
>
> $ cat ftp-list.txt | xargs curl -O -O -O [...]
>
> Curl _needs_ an "-Oalways" flag -- all addresses on the command line use
> the base filename to store locally. Else a script must precount the # of
> URLs, construct the proper number of "-O"s...

I came to think of how to do the above semi-nicely:

    $ cat ftp-list.txt | awk '{print $1 " -O";}' | xargs curl -O

It'll always give you at least one -O for each file! ;-)

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-12-06

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET