cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Curl query

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 29 Jan 2008 13:15:02 +0100 (CET)

On Tue, 29 Jan 2008, Preetam Joshi wrote:

> I am using curl command line tool, i am facing problem in sending a url from
> a file. Suppose my filename is new_url.txt I want to read the url from this
> file and pass it to curl, how do i do it. I tried using -F @filename. It
> saays badly formatted input field and -F illegally used here.
>
> How do i achieve the url passing from file.

So you're asking us how to write a shell script that pulls URLs one at a time
from a file and pass that to curl?

for a in `cat file`; do
   curl -O $a
done

Or if you want to do it slightly more fancy to reduce the number of
connections:

for a in `cat file`; do
   b=`echo -O $a`
   c=" $b$c"
done
curl $c

Or is this a question if curl can do that on its own? If so, the answer is no

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-01-29