cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Cannot make -o download files with {} qualifier

From: Michael-O <1983-01-06_at_gmx.net>
Date: Mon, 11 Nov 2013 23:09:39 +0100

Hi Dan,

Am 2013-11-09 12:14, schrieb Dan Fandrich:
> On Fri, Nov 08, 2013 at 02:21:59PM +0100, Michael-O wrote:
>> I am trying with curl
>>
>> curl 7.33.0 (x86_64-unknown-linux-gnu) libcurl/7.33.0 OpenSSL/1.0.0 zlib/1.2.3
>> Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
>> Features: GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL libz
>>
>> To download multiple files with {} and tell -o to save them to file_#1.html.
>>
>> I did:
>>
>> curl --proxy-negotiate -o file_#1.html -U : -x <omitted> http://curl.haxx.se/docs/{manpage,libs}.html
>>
>> Response is written to stdout and one file named 'file_#1.html' is created. I expected two files: manpage.html and libs.html.
>>
>> What am I doing wrong? Is that a bug?
>
> You didn't quote the URL in your example, which means that the shell would have
> expanded the arguments in {...} instead of curl. The first of the two expanded
> URLs would have corresponded to the file given in -o and have been written
> there, whereas the second URL didn't have a corresponding option so it would
> have gone to stdout.

this does not seem to add up. The man page for -o says:

Like in:

   curl http://{one,two}.site.com -o "file_#1.txt"

or use several variables like:

   curl http://{site,host}.host[1-5].com -o "#1_#2"

It does not quote the URL.

I have tried:

bin/curl --proxy-negotiate -o file_#1.html -U : -x <omitted>
"http://curl.haxx.se/docs/{manpage,libs}.html"

[1/3]: http://curl.haxx.se/docs/manpagelibs --> file_manpage.html
   % Total % Received % Xferd Average Speed Time Time Time
  Current
                                  Dload Upload Total Spent Left
  Speed
100 894 100 894 0 0 9138 0 --:--:-- --:--:-- --:--:--
14190
100 291 100 291 0 0 1455 0 --:--:-- --:--:-- --:--:--
  1455

[2/3]: http://curl.haxx.se/docs/libslibs --> file_libs.html
100 288 100 288 0 0 3728 0 --:--:-- --:--:-- --:--:--
  3728

bin/curl --proxy-negotiate -o file_#1.html -U : -x <omitted>
'http://curl.haxx.se/docs/{manpage,libs}.html'

[1/3]: http://curl.haxx.se/docs/manpagelibs --> file_manpage.html
   % Total % Received % Xferd Average Speed Time Time Time
  Current
                                  Dload Upload Total Spent Left
  Speed
100 894 100 894 0 0 19796 0 --:--:-- --:--:-- --:--:--
22350
100 291 100 291 0 0 1918 0 --:--:-- --:--:-- --:--:--
  1918

[2/3]: http://curl.haxx.se/docs/libslibs --> file_libs.html
100 288 100 288 0 0 3612 0 --:--:-- --:--:-- --:--:--
  3612

What is my fault here?

Thanks,

Michael
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-11-11