yes is a Unix command that will spit out and infinite stream of y's. In a post on his blog Matthias Endler, an engineer at trivago, shares that there's more than meets the eye to make this happen in a performant way.

The trivial program yes turns out not to be so trivial after all. It uses output buffering and memory alignment to improve performance. Re-implementing Unix tools is fun and makes me appreciate the nifty tricks, which make our computers fast.

https://matthias-endler.de/2017/yes/