JeffreyLau
V2EX  ›  macOS

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

  •  
  •   JeffreyLau · Dec 9, 2015 · 5033 views
    This topic created in 3989 days ago, the information mentioned may be changed or developed.

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

    18 replies  •  2015-12-11 09:27:34 +08:00
    JeffreyLau
    JeffreyLau
    OP
    Dec 9, 2015
    1
    卧槽, man yes
    Hello1995
    Hello1995
    Dec 9, 2015 via Android
    2
    内事不决问男人(man),外事不决问维基(wiki)。
    ETiV
    ETiV
    Dec 9, 2015 via iPhone
    3
    越狱了的 iPhone 在 terminal 里执行了一下 yes ……
    JeffreyLau
    JeffreyLau
    OP
    Dec 9, 2015
    4
    @Hello1995 我可是有女票的人👀
    JeffreyLau
    JeffreyLau
    OP
    Dec 9, 2015
    5
    @ETiV hhhhhhh 这个什么效果?好像没法终止
    arbipher
    arbipher
    Dec 9, 2015
    6
    这个是给 pipe 用的
    ETiV
    ETiV
    Dec 9, 2015 via iPhone
    7
    只能按 home 键了……
    @JeffreyLau
    JeffreyLau
    JeffreyLau
    OP
    Dec 9, 2015 via iPhone
    8
    @arbipher 诶?具体点呢
    JeffreyLau
    JeffreyLau
    OP
    Dec 9, 2015 via iPhone
    9
    @arbipher 竟然会有这种功能
    JeffreyLau
    JeffreyLau
    OP
    Dec 9, 2015 via iPhone
    10
    @ETiV 对哦,,
    shuding
    shuding
    Dec 10, 2015
    11
    "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
    Strikeactor
    Dec 10, 2015
    12
    跑几个 yes >/dev/null 2>&1 & 可是暖手的好方法
    arbipher
    arbipher
    Dec 10, 2015❤️1
    13
    @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
    tanteng
    Dec 10, 2015
    14
    果然有奇妙的事情发生!
    jsfaint
    jsfaint
    Dec 10, 2015
    15
    yes no
    xiaket
    xiaket
    Dec 10, 2015
    16
    这个是 unix 下的命令, linux 下也有, 脚本编程经常用的.
    sakeven
    sakeven
    Dec 10, 2015
    17
    。。。 unix 的通用命令
    JeffreyLau
    JeffreyLau
    OP
    Dec 11, 2015 via iPhone
    18
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1705 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 00:05 · PVG 08:05 · LAX 16:05 · JFK 19:05
    ♥ Do have faith in what you're doing.