0

Consider the canonical example of a Unix fork bomb:

DANGER: running the following command, might crash your system.

:(){ :|: & };:

I wonder why & (background) is needed in order to use up all of the system's resources - after all the function : is recursive? Also, I have attempted to execute : without &, but in this case Bash doesn't accept the syntax, why?

Shuzheng
  • 4,411
  • As to why it didn't accept the syntax: https://askubuntu.com/a/521943 – muru Dec 10 '19 at 08:24
  • @muru - so the only purpose of & is to make the fork bomb run faster? At least that's what I understand from your answer :) – Shuzheng Dec 10 '19 at 09:06
  • Not my answer. However, seems like it. There's at least one other answer, which says it isn't necessary: "I note that at least on my Arch VM, the need to background the process is not a requirement to have the same end result, to consume all available process space and render the host b0rked." – muru Dec 10 '19 at 10:45

0 Answers0