Re:A little story about the `yes` Unix command
by dolmen on Friday July 22, 2022 @05:27AM
(#32190174)
1. Performance of yes is not a concern for that "common case" (well, is that case still common? who writes only interactive program that require yes/no anwers from the terminal?).
2. Filling a buffer has much less CPU (power) cost as it doesn't involve context switching like I/O.
Isn’t filling a buffer going to be a huge waste of CPU for the common case where the command only needs to provide one or two “yes”es? (Common case as in, its intended use of working around scripts that interactively prompt you to continue, etc…)