This is the mail archive of the cygwin-talk mailing list for the cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

My pipe flushes late


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]