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

Bernard Blackham bernard at blackham.com.au
Fri Jul 26 23:41:05 WST 2002


On Fri, Jul 26, 2002 at 06:18:33PM +0800, Cameron Patrick wrote:
> 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

Hmmmm, I foolishly tried this (despite all warnings) and a killall
zsh saved me from it all (strangely without killing the 15 xterm/zsh
sessions which were in use). Anyway, it appears that its redefining the
: operator, which from the bash manual:

       : [arguments]
              No effect; the command does nothing beyond expand­
              ing arguments and performing any specified redirec­
              tions.  A zero exit code is returned.

Interestingly enough you can redefine . - _ + / * = too just like any other
shell function. You could make some trippy math-command-line
scripts... Cool! (I'm working on it).

And for anyone who would like to try running the script on a
production server (*cough*) do it at a console, have your kernel
compiled with magic keys, and have alt+prtsc+k ready. You shouldn't
have any problems ;)

Bernard

-- 
 Bernard Blackham
 bernard at blackham.com.au
 Australian Linux Technical Conference 2003: http://www.linux.conf.au/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20020726/289ec6da/attachment.pgp>


More information about the plug mailing list