From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21751 invoked by alias); 20 Aug 2008 11:55:09 -0000 Received: (qmail 21743 invoked by uid 22791); 20 Aug 2008 11:55:08 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 20 Aug 2008 11:54:29 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KVmGc-0000Za-0P for cygwin-talk@cygwin.com; Wed, 20 Aug 2008 11:54:22 +0000 Received: from 193.215.235.43 ([193.215.235.43]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Aug 2008 11:54:21 +0000 Received: from rschm by 193.215.235.43 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Aug 2008 11:54:21 +0000 To: cygwin-talk@cygwin.com From: Robert Schmidt Subject: My pipe flushes late Date: Wed, 20 Aug 2008 11:55:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) X-IsSubscribed: yes Mailing-List: contact cygwin-talk-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-talk-owner@cygwin.com Reply-To: The Vulgar and Unprofessional Cygwin-Talk List X-SW-Source: 2008-q3/txt/msg00049.txt.bz2 I basically need to pass some output through d2u, then add a prefix to each line. Most importantly, I need the line to flush through the pipe immediately. However, d2u (or the pipe itself) caches/flushes late. For example: $ d2u | sed "s/^/prefix: /" a b^D prefix: a prefix: b $ I need to see: $ d2u | sed "s/^/prefix: /" a prefix: a b^D prefix: b $ If I replace d2u with cat above, it flushes each line, but I need d2u. If I replace d2u with sed s/\x0D//g, the output also flushes late. I know I can probably write one sed script to replace the above pipe, but my prefix is actually not static (should be a time stamp). How can I accomplish this? My cygwin is up to date (Aug 20). Cheers, Robert