TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Yes command – output a string repeatedly until killed

1 点作者 sigma5将近 2 年前

3 条评论

Someone将近 2 年前
For comparison, the OpenBSD version: <a href="https:&#x2F;&#x2F;github.com&#x2F;openbsd&#x2F;src&#x2F;blob&#x2F;master&#x2F;usr.bin&#x2F;yes&#x2F;yes.c">https:&#x2F;&#x2F;github.com&#x2F;openbsd&#x2F;src&#x2F;blob&#x2F;master&#x2F;usr.bin&#x2F;yes&#x2F;yes.c</a><p>That’s a lot simpler, but also slower (see <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;unix&#x2F;comments&#x2F;6gxduc&#x2F;how_is_gnu_yes_so_fast" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;unix&#x2F;comments&#x2F;6gxduc&#x2F;how_is_gnu_yes...</a>, discussed in <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14542938">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14542938</a>)
dusted将近 2 年前
I&#x27;m always impressed by the amount of code in this implementation, I&#x27;d like to know more about the scenarios where it was determined that for(;;) puts(&quot;y&quot;); was too slow.
rektide将近 2 年前
A long time ago I wrote a program that would pass through stdin but would also inject newlines every N seconds. Useful for log monitoring as a visual &amp; temporal separator.