V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
JeffreyLau
V2EX  ›  macOS

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

  •  
  •   JeffreyLau · 2015-12-09 23:39:43 +08:00 · 3641 次点击
    这是一个创建于 3055 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    18 条回复    2015-12-11 09:27:34 +08:00
    JeffreyLau
        1
    JeffreyLau  
    OP
       2015-12-09 23:48:12 +08:00
    卧槽, man yes
    Hello1995
        2
    Hello1995  
       2015-12-09 23:51:46 +08:00 via Android
    内事不决问男人(man),外事不决问维基(wiki)。
    ETiV
        3
    ETiV  
       2015-12-09 23:54:13 +08:00 via iPhone
    越狱了的 iPhone 在 terminal 里执行了一下 yes ……
    JeffreyLau
        4
    JeffreyLau  
    OP
       2015-12-09 23:54:28 +08:00
    @Hello1995 我可是有女票的人👀
    JeffreyLau
        5
    JeffreyLau  
    OP
       2015-12-09 23:54:52 +08:00
    @ETiV hhhhhhh 这个什么效果?好像没法终止
    arbipher
        6
    arbipher  
       2015-12-09 23:55:29 +08:00
    这个是给 pipe 用的
    ETiV
        7
    ETiV  
       2015-12-09 23:56:21 +08:00 via iPhone
    只能按 home 键了……
    @JeffreyLau
    JeffreyLau
        8
    JeffreyLau  
    OP
       2015-12-09 23:57:08 +08:00 via iPhone
    @arbipher 诶?具体点呢
    JeffreyLau
        9
    JeffreyLau  
    OP
       2015-12-09 23:57:36 +08:00 via iPhone
    @arbipher 竟然会有这种功能
    JeffreyLau
        10
    JeffreyLau  
    OP
       2015-12-09 23:57:58 +08:00 via iPhone
    @ETiV 对哦,,
    shuding
        11
    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
        12
    Strikeactor  
       2015-12-10 00:10:37 +08:00
    跑几个 yes >/dev/null 2>&1 & 可是暖手的好方法
    arbipher
        13
    arbipher  
       2015-12-10 00:22:34 +08:00   ❤️ 1
    @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
        14
    tanteng  
       2015-12-10 00:42:45 +08:00
    果然有奇妙的事情发生!
    jsfaint
        15
    jsfaint  
       2015-12-10 09:24:57 +08:00
    yes no
    xiaket
        16
    xiaket  
       2015-12-10 09:30:32 +08:00
    这个是 unix 下的命令, linux 下也有, 脚本编程经常用的.
    sakeven
        17
    sakeven  
       2015-12-10 11:41:04 +08:00
    。。。 unix 的通用命令
    JeffreyLau
        18
    JeffreyLau  
    OP
       2015-12-11 09:27:34 +08:00 via iPhone
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2501 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 15:52 · PVG 23:52 · LAX 08:52 · JFK 11:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.