delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/02/08/08:10:32

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
From: "John Chatelle" <johnch AT medent DOT com>
To: cygwin AT cygwin DOT com
Subject: RE: tee piping to head gives error message
Date: Tue, 8 Feb 2005 08:09:45 -0500
Message-Id: <20050208130407.M2469@medent.com>
In-Reply-To: <F76C9B2DA2FC4C4CA0A18E288BBCBCF71026EDBB@nihexchange24.nih.gov>
References: <F76C9B2DA2FC4C4CA0A18E288BBCBCF71026EDBB AT nihexchange24 DOT nih DOT gov>
X-OriginatingIP: 65.114.41.101 (johnch)
MIME-Version: 1.0
X-MailScanner: Found to be clean
X-IsSubscribed: yes


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/

- Raw text -


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