Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: single line command to download multiple files with CURL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: single line command to download multiple files with CURL



At 10:10 AM +0200 11/24/04, Bogdan Fulau wrote:
Hello!

I am using CURL as my download manager and would like to know if it's possible to get more than one file at a time from a single command.

That is, instead of writing

curl -O http://address/file1.txt
curl -O http://address/file2.dmg
curl -O http://address/file3.sit

Did you *read* the man page??

Review the {} qualifier.

At 11:27 AM -0500 11/24/04, Jason Deraleau wrote:
Just use a basic loop:

$ for i in "file1.txt file2.dm file3.sit"
do
	curl -O http://address/${i}
done

Not necessary:

% curl -O "http://address/file{1.txt,2.dmg,3.sit}";

If the files all had the same extension:

% curl -O "http://address/file[1-3].ext";

Which is the same as:

% curl -o file#1.ext "http://address/file[1-3].ext";

where we use a symbolic replacement.

Or if we wanted all .sit and .dmg and .txt files in a range:

% curl -o file#1.#2 "http://address/file[1-3].{sit,dmg,txt}";
--

-dhan

------------------------------------------------------------------------
Dan Shoop                                                   AIM: iWiring
Systems & Networks Architect                     http://www.iwiring.net/
email@hidden                                 http://www.ustsvs.com/

pgp key fingerprint: FAC0 9434 B5A5 24A8 D0AF  12B1 7840 3BE7 3736 DE0B

iWiring designs and supports Internet systems and networks based on
Mac OS X, unix, and Open Source application technologies and offers
24x7, guaranteed support to registered clients, at affordable rates.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >single line command to download multiple files with CURL (From: Bogdan Fulau <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.