curl-users
Re: Curl returns exit code 18 for remote file
Date: Tue, 2 Aug 2011 16:26:39 -0400 (EDT)
On Tue, August 2, 2011 16:16, Dan Fandrich wrote:
> On Tue, Aug 02, 2011 at 04:07:08PM -0400, James B. Byrne wrote:
>> The problem we discovered with --head is that even with the
>> --silent
>> option it causes this to be displayed in STDOUT:
>>
>> Content-Length: 0
>
> Yes, that's what --head requests.
>
>> expected occurrence. This I do not want. Nor do I wish to
>> redirect STDOUT, for other reasons.
>
> Then use the special curl option "-o /dev/null" and avoid the need
> to redirect stdout yourself :-)
>
>> Grep is a workable solution. In fact, that was our original
>> approach. The difficulty being that the switch to cURL away from
>> the basic ftp client was to get rid of that very idiom and avoid
>> having to parse output to STDOUT. I just wanted a simple exit
>> code and nothing else. And I just cannot seem to get it.
>
> Those two additional options should do it. Don't forget that curl
> is designed to transfer files, so outputing absolutely nothing goes
> against its philosophy.
>
Thanks for that.
Going cross-grain to others philosophies seems to be a trait of
mine. I have no idea why. But to me, where present, a --silent or
--quiet option should mean absolute silence, no stdout at all.
--sulk is probably more apt if a program insists on saying something
when it is told to shut up.
I will give the -o option a whirl. But even when I get the output
to quieten I am still left with the return code of 18, for which I
have no explanation.
-- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB_at_Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3 ------------------------------------------------------------------- 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.htmlReceived on 2011-08-02