← Back to context

Comment by ButlerianJihad

15 days ago

> It by definition does not have to optimized to oblivion. Same goes for echo.

I don't know about oblivion, and non-portable optimizations are not good. But perhaps yes(1) and echo(1) are among the tightest inner loops of scripting. You would not want them to bottleneck the pipeline. You'd want them pumping output faster than it could be accepted or written out.

Perhaps there is an opportunity for a /dev/yes, which acts like /dev/zero, only it continually outputs whatever filename it was opened as (good luck!)

I think NetBSD and OpenBSD do just fine with the simple version. Or maybe they write better scripts :)