delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/12/01/00:48:02

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:references:to:reply-to:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=kYOKjHPCs/rFQfHx
yZE0yLKx2poPhsOJRDEB2FEeyBbHHnlIVOYyYxswLrn2RIYAu91pzTtkwnIhlqHh
HtM9xS9tPtAt5Qh4tWrsEuG6lHpE0btaeaVUdHZyUSAUQtDnXwh4vZJzxZjXSeMR
vWgbeqK0WlZcYk0ii9ik01Z70WI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:references:to:reply-to:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=Orzj3hNsbwE3EtyJMfN6CJ
QHmCg=; b=SXZ9/KaZecx0S7cWfCHNrgODwUe31K1pJmAvMIVWqo7kMfP7mPFVSp
zX61Ox9QYLgXGdrAltKTpEFcvrHZp8GTk1mpqh7096ZLXhdk8dFcBv14EX54NNGf
lsXiQGXawrTsPaaEWNWMbGLvN1lvu7lo0oA49J9T2rxMhwGpvXTpM=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Hx-spam-relays-external:shaw.ca, H*r:shaw.ca, H*RU:shaw.ca, H*R:D*ca
X-HELO: smtp-out-so.shaw.ca
X-Authority-Analysis: v=2.2 cv=cNuQihWN c=1 sm=1 tr=0 a=WqCeCkldcEjBO3QZneQsCg==:117 a=WqCeCkldcEjBO3QZneQsCg==:17 a=IkcTkHD0fZMA:10 a=NEAV23lmAAAA:8 a=NaM-9we5AAAA:8 a=uPZiAMpXAAAA:8 a=EidwTTQiwT17KCbf4KEA:9 a=QEXdDO2ut3YA:10 a=Bn2pgwyD2vrAyMmN8A2t:22 a=KQxfyNE6DlFdbrDZV3aZ:22 a=svzibyHiZmA4t4YY0eFS:22
Subject: Re: silent option not silencing cURL error
References: <CAAXzdLWeMosC0aowDsefXZ2RZ0kowhC46csw7xpmMbcfeRASTg AT mail DOT gmail DOT com>
To: cygwin AT cygwin DOT com
Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Message-ID: <353aa60d-36cd-cd7c-150d-a2c1c1815cc7@SystematicSw.ab.ca>
Date: Wed, 30 Nov 2016 22:46:12 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0
MIME-Version: 1.0
In-Reply-To: <CAAXzdLWeMosC0aowDsefXZ2RZ0kowhC46csw7xpmMbcfeRASTg@mail.gmail.com>
X-CMAE-Envelope: MS4wfMAG5zHaBMtNHjESVwlfoPu4qwyxZmlAUFElsZqRCqixmQPDXEou2giZfygABiBYoo3+cgzPD2raH/EGvJUvQaKFdGTmChktVywEp6O/FoUDkczdmQUd uGS6Un1JcfQwFNlRyukLtN2UaaNnaYStl4YYV5YoM5p29T51ww+2mFwWCoQELMzEWFGfKCWDgjjdPA==
X-IsSubscribed: yes

On 2016-11-30 20:00, Steven Penny wrote:
>     $ curl --version
>     curl 7.51.0
> Piping cURL to head gives me an error, as expected:
>     $ curl https://github.com/github | head
>     [...]
>     (23) Failed writing body
> However adding the silent option, is not silencing it:
>     $ curl --silent https://github.com/github | head
>     [...]
>     (23) Failed writing body
> I can quiet the error with:
>     curl https://github.com/github 2>/dev/null | head
> but silent should be taking care of this. Note the Windows version
> here works as expected:
> http://bintray.com/vszakats/generic/curl
> cross post:
> http://stackoverflow.com/q/40901579/silent-option-not-silencing-curl-error

This is a common problem: not handling a closed pipe silently.
Testing curl on WSL/UfW and Debian does not give this error.
This may be a regression in the newer Cygwin curl version 7.51 vs older 
UfW 7.35 and Debian 7.38, or it could be a design decision.
See if has been reported upstream at curl.haxx.se, and report it if not.
Using | sed '10q' also gives the error.
You can work around it using | awk 'NR<=10', | awk -vn=10 'NR<=n', or 
| awk 'NR<=n' n=10 to get a similar result.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019