cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sat, 9 Nov 2013 12:14:00 +0100

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.

>>> Dan
-------------------------------------------------------------------
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-09