public inbox for cygwin-talk@cygwin.com
 help / color / mirror / Atom feed
* My pipe flushes late
@ 2008-08-20 11:55 Robert Schmidt
  2008-08-20 12:07 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Robert Schmidt @ 2008-08-20 11:55 UTC (permalink / raw)
  To: cygwin-talk

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

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

end of thread, other threads:[~2008-08-20 16:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-20 11:55 My pipe flushes late Robert Schmidt
2008-08-20 12:07 ` Eric Blake
2008-08-20 13:20   ` Robert Schmidt
2008-08-20 12:16 ` Brian Dessent
2008-08-20 12:40 ` Brian Dessent
2008-08-20 13:15   ` Robert Schmidt
2008-08-20 13:31     ` Brian Dessent
2008-08-20 16:12     ` Christopher Faylor

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