It just takes all your computers CPU and RAM by making endless copies of itself. Best case your PC gets sluggish, worst it crashes. Won’t do any lasting damage. It’s called a “Fork Bomb”
It’s worse, a single infinite loop will warm up the computer a bit, this program starts two copies of itself, each of which starts two copies of itself… unless you’ve set some limits on things the computer’s going to be locked up within seconds.
This is a Bash fork bomb, a malicious function definition that recursively calls itself:
:() — defines a function named : (yes, just a colon).
{ :|:& } — the function's body:
:|: — pipes the output of the function into another call of itself, creating two processes each time.
& — runs the call in the background, meaning it doesn’t wait for completion.
; — ends the function definition.
: — finally, this invokes the function once, starting the bomb.
The form “function(){content}” in bash defines a function called “function” that, when called by name, executes “content”. This forkbomb defines a function called : (just a colon) which calls itself twice in a new subprocess (the two colons inside the curly brackets). It thus spawns more and more copies of itself until it overwhelms your processor.
what does it do? (no i am not trying it on my machine)
It just takes all your computers CPU and RAM by making endless copies of itself. Best case your PC gets sluggish, worst it crashes. Won’t do any lasting damage. It’s called a “Fork Bomb”
function tombombadil() { tombombadil | tombombadil & } tombombadil()Each time it calls itself, it forks a background copy too and sends Gandalf deeper into the abyss
sounds likr there is some crazy lotr lore behind this
so basically
10 print welcome to hell
20 goto 10
30 end
It’s worse, a single infinite loop will warm up the computer a bit, this program starts two copies of itself, each of which starts two copies of itself… unless you’ve set some limits on things the computer’s going to be locked up within seconds.
This is a Bash fork bomb, a malicious function definition that recursively calls itself:
From a fish user I appreciate this
Why are the square brackets there?
There aren’t any square brackets.
The form “function(){content}” in bash defines a function called “function” that, when called by name, executes “content”. This forkbomb defines a function called : (just a colon) which calls itself twice in a new subprocess (the two colons inside the curly brackets). It thus spawns more and more copies of itself until it overwhelms your processor.
I understood, it’s just that @Delta_V@lemmy.world added square brackets to his explanation.
because I didn’t know what it did either, then made a typo in the ChatGPT prompt when asking about it