public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* silent option not silencing cURL error
@ 2016-12-01  3:00 Steven Penny
  2016-12-01  5:47 ` Brian Inglis
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Penny @ 2016-12-01  3:00 UTC (permalink / raw)
  To: cygwin

    $ 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

--
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: silent option not silencing cURL error
  2016-12-01  3:00 silent option not silencing cURL error Steven Penny
@ 2016-12-01  5:47 ` Brian Inglis
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Inglis @ 2016-12-01  5:47 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-01  5:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-01  3:00 silent option not silencing cURL error Steven Penny
2016-12-01  5:47 ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).