From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38612 invoked by alias); 1 Dec 2016 05:47:07 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 38083 invoked by uid 89); 1 Dec 2016 05:46:42 -0000 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 Received: from smtp-out-so.shaw.ca (HELO smtp-out-so.shaw.ca) (64.59.136.138) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Dec 2016 05:46:18 +0000 Received: from [192.168.1.100] ([174.0.238.184]) by shaw.ca with SMTP id CKCCcV8oBIwqSCKCDcYtky; Wed, 30 Nov 2016 22:46:16 -0700 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: To: cygwin@cygwin.com Reply-To: Brian.Inglis@SystematicSw.ab.ca From: Brian Inglis Message-ID: <353aa60d-36cd-cd7c-150d-a2c1c1815cc7@SystematicSw.ab.ca> Date: Thu, 01 Dec 2016 05:47:00 -0000 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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfMAG5zHaBMtNHjESVwlfoPu4qwyxZmlAUFElsZqRCqixmQPDXEou2giZfygABiBYoo3+cgzPD2raH/EGvJUvQaKFdGTmChktVywEp6O/FoUDkczdmQUd uGS6Un1JcfQwFNlRyukLtN2UaaNnaYStl4YYV5YoM5p29T51ww+2mFwWCoQELMzEWFGfKCWDgjjdPA== X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00003.txt.bz2 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