|
|
|
|
|
by rootnod3
26 days ago
|
|
It makes the code way less auditable and more prone to bugs and errors. Or let the kernel change its paging mechanism and now your fucking “yes” tool needs an update to be “efficient”. The tool has one job…print yes or another word you give it. It by definition does not have to optimized to oblivion. Same goes for echo. It’s arsinine to optimize it to that level instead of just keeping it readable and maintainable. And portable. The gnu version is 100% not easily portable because it has assumptions about the underlying kernel. |
|
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!)