tee piping to head gives error message

John Chatelle johnch@medent.com
Tue Feb 8 14:50:00 GMT 2005

Don't break head.

  We won't want "Argument list too long" when piping a stream to head. 

---------- Original Message -----------
From: "Buchbinder, Barry (To: cygwin-cygwin.com
Sent: Mon, 7 Feb 2005 13:49:49 -0500
Subject: RE: tee piping to head gives error message

> At Monday, February 07, 2005 1:13 PM, Dave Korn wrote:
> >> -----Original Message-----
> >> From: cygwin-owner On Behalf Of Buchbinder, Barry (NIH/NIAID)
> >> Sent: 07 February 2005 17:28
> > 
> >> As described in the Subject.  Though it seems that everything works
> >> OK; tee just gives and error message under some circumstances.
> >> 
> >> /tmp> cat stafflist.htm | tee ttt | head > /dev/null
> >> tee: standard output: Broken pipe
> > 
> >> So the file that tee write looks good and the write error is
> >> only to the pipe.
> > 
> >   That'll be because head closed the pipe, and tee was still trying
> > to write into it.
> Further experimentation supported that.  Inserting cat between tee 
> and head did not eliminate the error message, while inserting sort did.
> >> So head seems to be passing on the number of lines that ones
> >> asks it to pass on.
> > 
> >   Given that the purpose of head is to print the first few lines of a
> > file, it kind of makes sense to me that it would close the file after
> > it's read them rather than keeping the input file open and manually
> > reading-and-discarding the entire rest of it for no good reason.
> Agreed.
> >   So I reckon this is as-expected and by-design behaviour.
> with the upstream maintainers, or to patch himself.  (I won't 
> complain if he doesn't patch it.  Taking on coreutils was quite a 
> commitment -- well deserving of the two gold stars -- and I know 
> that fixing this may be a low priority.)  Unfortunately, though PTC, 
> I'm not capable of providing a patch. In any case, tee seems to save 
> its input as desired, so while the error message is annoying and 
> misleading, I suppose that one can live with it.
------- Cut -------

This message and any attachments may contain information that is protected
by law as privileged and confidential, and is transmitted for the sole use
of the intended recipient(s). If you are not the intended recipient, you
are hereby notified that any use, dissemination, copying or retention of
this e-mail or the information contained herein is strictly prohibited. If
you have received this e-mail in error, please immediately notify the
sender by e-mail, and permanently delete this e-mail.

This message has been scanned for viruses and
dangerous content by MailScanner and F-Prot.

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

More information about the Cygwin mailing list