bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] wc: line-buffer the printed counts


From: Pádraig Brady
Subject: [PATCH] wc: line-buffer the printed counts
Date: Tue, 22 Dec 2009 09:10:08 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

wc is a essentially a digesting function like sha etc.
in that it produces a 1 line summary per file.
The attached patch ensures that those lines are output
atomically for concurrent wc processes.

Note in general one can use `stdbuf -oL cmd` to line-buffer
a process which outputs to stdout, but I think this
should be done internally in this case.

Note also that for commands which don't use stdio for output,
one could use sed to to the line buffering `cmd | sed -n p`.

cheers,
Pádraig.

Attachment: wc-atomic.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]