在 OS X 的终端里输入 yes 会有奇妙的事情发生!

2015-12-09 23:39:43 +08:00
 JeffreyLau

今天写一个 python 小游戏,测试的时候意外退出,我不知道,仍然输入 yes ,然后奇妙的事情就发生了!我这是发现了一个 OS X 的 bug 吗 hhhhhhhhhh

3654 次点击
所在节点    macOS
18 条回复
JeffreyLau
2015-12-09 23:48:12 +08:00
卧槽, man yes
Hello1995
2015-12-09 23:51:46 +08:00
内事不决问男人(man),外事不决问维基(wiki)。
ETiV
2015-12-09 23:54:13 +08:00
越狱了的 iPhone 在 terminal 里执行了一下 yes ……
JeffreyLau
2015-12-09 23:54:28 +08:00
@Hello1995 我可是有女票的人👀
JeffreyLau
2015-12-09 23:54:52 +08:00
@ETiV hhhhhhh 这个什么效果?好像没法终止
arbipher
2015-12-09 23:55:29 +08:00
这个是给 pipe 用的
ETiV
2015-12-09 23:56:21 +08:00
只能按 home 键了……
@JeffreyLau
JeffreyLau
2015-12-09 23:57:08 +08:00
@arbipher 诶?具体点呢
JeffreyLau
2015-12-09 23:57:36 +08:00
@arbipher 竟然会有这种功能
JeffreyLau
2015-12-09 23:57:58 +08:00
@ETiV 对哦,,
shuding
2015-12-10 00:09:04 +08:00
"By running the yes command twice via Terminal under Mac OS X, users were able to max out their computer's CPU, and thus see if the failure was heat related.",哈哈哈……
Strikeactor
2015-12-10 00:10:37 +08:00
跑几个 yes >/dev/null 2>&1 & 可是暖手的好方法
arbipher
2015-12-10 00:22:34 +08:00
@JeffreyLau
It's usually used as a quick and dirty way to provide answers to an interactive script:

> yes | rm -r large_directory
> yes | fsck /dev/foo

http://unix.stackexchange.com/questions/102484/what-is-the-point-of-the-yes-command

还可以测试用, yes <anything> | your_script
tanteng
2015-12-10 00:42:45 +08:00
果然有奇妙的事情发生!
jsfaint
2015-12-10 09:24:57 +08:00
yes no
xiaket
2015-12-10 09:30:32 +08:00
这个是 unix 下的命令, linux 下也有, 脚本编程经常用的.
sakeven
2015-12-10 11:41:04 +08:00
。。。 unix 的通用命令
JeffreyLau
2015-12-11 09:27:34 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/242398

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX