War*_*ith 8 command-line special-characters
我承认这是一项家庭作业,但我无法解释以下命令行:
警告:这是所谓的叉形炸弹!这个命令行会消耗所有 RAM 和 CPU 使你的电脑崩溃(相信我,我试过了......)
:(){ :|:& };:
Run Code Online (Sandbox Code Playgroud)
据我所知,我应该在这里独自完成到目前为止我所拥有的(搜索这些字符非常令人沮丧)。
我猜:是fork?但在这里我完全迷路了!我愿意学习,所以也许有人有很好的资源可以让我阅读?
Egi*_*gil 14
:() # define ':' -- whenever we say ':', do this:
{ # beginning of what to do when we say ':'
: # load another copy of the ':' function into memory...
| # ...and pipe its output to...
: # ...another copy of ':' function, which has to be loaded into memory
# (therefore, ':|:' simply gets two copies of ':' loaded whenever ':' is called)
& # disown the functions -- if the first ':' is killed,
# all of the functions that it has started should NOT be auto-killed
} # end of what to do when we say ':'
; # Having defined ':', we should now...
: # ...call ':', initiating a chain-reaction: each ':' will start two more.
Run Code Online (Sandbox Code Playgroud)
资料来源:维基百科上的叉形炸弹