On 23/06/16 08:13, Paul Eggert wrote: > Incidentally, 'yes' has a different bug: it mishandles the case where > 'write' succeeds but returns a value less than the buffer size. I'll try > to look into that too. Simplest would be to use stdio (the comments > indicate this has performance issues but I don't know what they are, > anyway correctness trumps performance). Good spot on the yes(1) write(2) bug. Shouldn't impact too often due to smallish BUFSIZ, and subsequent writes catching ENOSPC, but definitely could cause issues. The attached should fix that up, and keep the same performance characteristics. cheers, Pádraig