Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

:(){ :|:& };: Forkbomb? [duplicate]

Possible Duplicate:
The following bash command will spawn processes to kernel death. Can you explain the syntax?

:(){ :|:& };:

running this fork() unlimited .. Can one please explain this bash script ?

like image 998
webminal.org Avatar asked Jul 26 '10 09:07

webminal.org


1 Answers

You define a function called :. Inside this function you call this function twice (:|:) and then you send that process to the background (&). Then you finally call it at the end.

Because of the recursive nature, you'll keep forking. Since there is no base case, the recursion will never end.

like image 54
Daniel Egeberg Avatar answered Sep 23 '22 05:09

Daniel Egeberg