Paul Eggert wrote:
> $ (echo 'x'; sleep 10; echo y) | dd ibs=3 obs=3
> 
> POSIX says that in this case the output data must be reblocked into
> blocks of 3 bytes.  With the working 'dd', you'll see a pause of 10
> seconds (because the first 'echo' outputs only 2 bytes), then the x and
> y right away (because we now have all 4 input bytes, and can issue a
> write of 3 bytes and a write of 1 byte).  With a buggy 'dd', you'll see
> the 'x' right away (because we output a 2-byte block), then a pause of
> 10 seconds, then a 'y' (the other 2-byte block).
> 
> The simplest fix I see is to revert the patch.  Of course one could up
> with something fancier....
> 

Thanks for that Paul.
That certainly isn't obvious, and deserves a comment in the code.

A question so on the default behaviour of dd.
Should it behave like bs=512 or ibs=512 obs=512,
i.e. should it memcpy/reblock by default?

cheers,
Pádraig.


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to