public inbox for cygwin-talk@cygwin.com
 help / color / mirror / Atom feed
From: Robert Schmidt <rschm@broadpark.no>
To: cygwin-talk@cygwin.com
Subject: My pipe flushes late
Date: Wed, 20 Aug 2008 11:55:00 -0000	[thread overview]
Message-ID: <g8h0l5$dv8$1@ger.gmane.org> (raw)

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

             reply	other threads:[~2008-08-20 11:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-20 11:55 Robert Schmidt [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='g8h0l5$dv8$1@ger.gmane.org' \
    --to=rschm@broadpark.no \
    --cc=cygwin-talk@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).