[plug] :(){ :|:&};:

Cameron Patrick cp at chem.com.au
Fri Jul 26 18:18:33 WST 2002


On Fri, 26 Jul 2002 18:01:30 +0800, ryan at is.as.geeky.as wrote:

| Just to clarify:
| 
| bash-prompt$ :(){ :|:&};:

Well, I haven't seen it before, but it isn't too hard to understand if you have some experience with shell scripts. Better laid-out, it looks like:

: ()
{
  : | : &
};
:

The first bit defines a function called ":".  The line ":|:&" runs two copies of the : function in the background. The | operator is used to pipe two commands together (like in "ls -l | less"), by starting each one as a separate process, with their input and output connected. In this case, the bit we care about is that each one runs in a separate process.  The & sign makes them both run in the background.

Each : will spawn two more :s, so it will keep going until the kernel runs out of PIDs, at which point your system will more than likely crash, and any attempt at saving it (e.g. killall -9 bash) will give an error like:
	bash: fork: Resource temporarily unavailable

CP.



More information about the plug mailing list