cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: url malformed error with simple curl usage

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 20 Mar 2010 22:48:17 +0100 (CET)

On Sat, 20 Mar 2010, Doug McNutt wrote:

> ** How about making curl behave more like cp or scp when the specified
> destination is a directory?
>
> curl http://example.com/with/subdirectories/wanted_file -o
> $HOME/Downloads/

I think could learn to like that, and it wouldn't cause any backwards
compatibility problems since the above command line won't really work with a
current curl.

> scp or cp will create a new file wanted_file in HOME/Downloads/. No o or O
> required.

I view curl to be more like 'cat' than 'cp' though. That's one reason why it
sends the data to stdout by default.

> ** There is a provision for transmitting multiple files with [ ] grep-like
> matching which I always have to look up in the man page:"
>
> curl http://example.com/with/subdirectories/[wanted_file] -o
> $HOME/Downloads/[1]
>
> just might work.

Yes, at least if written like this:

curl http://example.com/with/subdirectories/{wanted_file} -o
$HOME/Downloads/#1

(I changed the URLs to use example.com which is made for exactly that.)

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
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 2010-03-20