For the classical bash fork bomb:
:(){ :|:& };:
I modify it as following:
:(){ :& };:
Execute and it exits immediately. Per my understanding, :
function should recursively create child process in background. Why doesn't it work?
For the classical bash fork bomb:
:(){ :|:& };:
I modify it as following:
:(){ :& };:
Execute and it exits immediately. Per my understanding, :
function should recursively create child process in background. Why doesn't it work?
Because there's always only one recursion path of the function :()
The original fork bomb invokes two more instances simultaneously every invocation, using up system resources quickly. However your modified version only invokes itself once, making a simple recursion. It'll probably end up overflowing the stack and doing no more harm.