cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: url malformed error with simple curl usage

From: Scott Haneda <talklists_at_newgeo.com>
Date: Sat, 20 Mar 2010 12:00:46 -0700

On Mar 20, 2010, at 1:11 AM, Kamil Dudka wrote:

> On Saturday 20 of March 2010 04:47:59 Scott Haneda wrote:
>> That worked; downloaded the file to the current working directory and kept
>> the file name. But what if I want to download the file to some other
>> location?
>>
>> $curl http://www.google.com/intl/en_ALL/images/logo.gif -O ~/Desktop
>> % Total % Received % Xferd Average Speed Time Time Time
>> Current Dload Upload Total Spent Left Speed 100 8558 100 8558
>> 0 0 62538 0 --:--:-- --:--:-- --:--:-- 146k curl: (3) <url>
>> malformed
>
> You just mixed it up. '-O' parses the file name from URL, thus take no extra
> argument. Then the '~/Desktop' is treated as second URL. If you want to
> specify the file name manulally, you want to use '-o', which takes an
> argument.

So it is not possible to do what I desire, which is to use -O to parse the filename from the URL, and set an alternate save destination in the same command. curl will always save with -O to the cwd?

If that is the case, that is great to know, as I now know I will simply have to cd to the preferred directory first.

Thank you all

-- 
Scott * If you contact me off list replace talklists@ with scott@ * 
-------------------------------------------------------------------
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