It's a classic "fork bomb": https://en.m.wikipedia.org/wiki/Fork_bomb
Re:Explain shell
by lebanon_tn on Sunday February 10, 2019 @04:27AM
(#19127056)
Not quite wiki (you have to create your own notes) but you may find this utility helpful: https://github.com/sinclairtarget/um
Re:Explain shell
by PurpleRamen on Sunday February 10, 2019 @03:59AM
(#19126980)
You define a function named :, which calls iself and goes in the background. Then you call : at the end and start the neverending chain of :-calls till your memory bleeds.
Not really: the function `:` calls itself and _pipes_ into itself.
The difference is - from what I can deduce - that if it were to only call itself, there would be up to 2 `:` processes running at a time, while the bash call stack would grow indefinitely. Using all your RAM but not an actual fork bomb.
Adding the pipe makes the number of `:` processes grow exponentially, and very quickly you reach the limit of 16384 active processes (PIDs, actually) on a Linux box.
You have gazed upon the smileyface of doom.
Also, that does sound great.
Re:Explain shell
by lolikoisuru on Sunday February 10, 2019 @12:39PM
(#19128851)
It defines a function : that launches two copies of itself in the background. Then it calls that function.
bomb() { bomb | bomb & }; bomb
Re:Explain shell
by intertextuality on Sunday February 10, 2019 @07:22AM
(#19127518)
Its also known as a fork bomb! I have one tattooed on my arm.
Interesting that WSL does not take the entire host to doom.
Re:Explain shell
by reilly3000 on Sunday February 10, 2019 @12:08PM
(#19128634)
Oh it did. I have 32 cores, but still managed to have so many threads running that Task Manager itself went Not Reaponding.
I know comment moderation sucks, but it would be great to have some kind of wiki/comment system/human generated notes on popular commands.