cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Curl behavior with and without pipe

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Thu, 8 Apr 2010 21:06:17 +0200

On Thursday 08 of April 2010 20:51:30 Palmer, Robert wrote:
> Below, you will find a bit of a brain-teaser for me. In the first
> "curl" command it gives the expected listing of files on the 127.0.0.1
> server (with no other output) - however, the second command line (which
> only adds a stdout pipe to an egrep) gives additional output as if I had
> turned an option on for it. Any idea why? Also, how would I remove the
> extra output (which is nice to have in some cases just not this one)? I
> know that I can go in and possibly analyze what is going on with
> strace/truss type utilities - but, thought I would try this (possibly)
> quicker solution first. Thanks in advance for your help.

curl uses isatty(3) to check whether the output stream is terminal. It
returns 1 in the first case, but 0 in case of pipe connected. I think
you're looking for the option -s/--silent.

Kamil
-------------------------------------------------------------------
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.html
Received on 2010-04-08