There's a default Unix tool for that: https://www.man7.org/linux/man-pages/man1/yes.1.html
(Above 99% accuracy)