Mail Archives: cygwin/2007/09/12/13:36:36
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: <http://curl.haxx.se/docs/comparison-table.html>.
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:
<http://curl.haxx.se/docs/companies.html>.
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/
- Raw text -