3 ms·
:() defines a new function called : { :|:& } is the body of the function, where we call the : function recursively, piping (|) its output to another call to :,
by xav0989 3y ago
:() defines a new function called :
{ :|:& } is the body of the function, where we call the : function recursively, piping (|) its output to another call to :, then backgrounding the whole thing (&)
; indicate the end of a statement and the start of a new one
: and finally the last : calls the function we defined to start the chain
Essentially each time the function is ran, it creates 2 new copies of itself, which each create 2 copies of themselves, etc. until your OS stops responding and crashes.
Nowadays many shells recognize this particular fork bomb and refuse to execute it
- _flux 3y ago> Nowadays many shells recognize this particular fork bomb and refuse to execute it Nice try! Though, do they really? I quickly checked if I would find something like this in bash, zsh or tcsh and failed, but I only spent a minute or so..
- sva_ 3y agoWell I can experimentally confirm that it works on zsh/alacritty ;)