cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to avoid expantion

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 14 Jan 2014 00:01:30 +0100

On Mon, Jan 13, 2014 at 05:19:32PM -0500, frank ernest wrote:
> If I want to download a file with this name:
>
> http://example.com/file with {strange} (Name).txt
>
> How do I do it?
> Should I encode the spaces and brackets and braces?
> If you wanted to operate on o file in bash you would just quote it.

curl does its own braces expansion as well, so quoting for bash isn't enough.
You could URL-encode the name (e.g.
http://example.com/file%20with%20%7Bstrange%7D%20%28Name%29.txt) or use curl's
-g parameter to disable its own globbing. In any case, you'd have to URL-quote
the spaces since those are never allowed in a URL.

>>> 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 2014-01-14