cURL / Mailing Lists / curl-users / Single Mail


Re: Curl returns exit code 18 for remote file

From: James B. Byrne <>
Date: Tue, 2 Aug 2011 16:07:08 -0400 (EDT)

On Tue, August 2, 2011 15:48, Dan Fandrich wrote:

> If you're just interested in whether the file exists or not, the
> --head
> option should be sufficient.

The problem we discovered with --head is that even with the --silent
option it causes this to be displayed in STDOUT:

Content-Length: 0

Which, in a cron job, causes a notification email to be sent for an
expected occurrence. This I do not want. Nor do I wish to redirect
STDOUT, for other reasons.

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.

***          E-Mail is NOT a SECURE channel          ***
James B. Byrne      
Harte & Lyne Limited
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3
List admin:
Received on 2011-08-02