X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <46E82389.28C5B4D9@dessent.net> Date: Wed, 12 Sep 2007 10:36:09 -0700 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Webdav batch file transfer: curl, wget References: <75cc17ac0709111359u1b7635ej4cc3bab19658af46 AT mail DOT gmail DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Richard Ivarson wrote: > Just great. How I love these Unix tools - and Cygwin which makes Windows > useable. And of course the people helping each other. > > Btw, I still got two small questions: > 1) Is there a simpler way than the five "-O"'s I used? Would a wildcard be > possible (didn't find a mention in the manpage, however). You need to provide one -O for each URL. I don't think there's a way around that. If you use -o instead of -O you can use "#n" as a replacement variable to represent the stuff that was in the n-th {} or []. Try curl --user NAME:PASSWORD 'https://webdavserver.com/folder/file{AA,BB,CC,DD,EE}.txt' -o "file#1.txt" Here the URL is single quoted so that curl does the expansion of {} and not the shell, that way it is able to expand #1 into the contents of the first {} operator. > 2) What actually is the main difference between wget and curl ? They are different projects with different goals. There is a comparison chart at: . curl the command line tool is actually just a thin wrapper around libcurl the library, which is a general purpose library that can be used in any project. This sets it apart from wget as it makes it very easy to add http/ftp/et at. client capabilities to an application. The fact that it's BSD licensed also facilitates this, as can be seen at: . In my experience wget is more suited for doing things like downloading a recursive copy of an entire site including images and stylesheets. It even has an option for converting the locally downloaded copy to have links to the local copies of these items (instead of absolute http: URLs) so that it can be viewed offline. Curl on the other hand is better suited for http scripting where you are trying to emulate the actions of a user, such as when submitting form fields. Wget has the ability to do http POSTs but it only supports the old "application/x-www-form-urlencoded" content encoding and not the more sophisticated "multipart/form-data" encoding which allows for things like file uploads. Curl supports both. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/