Funny Forkbomb

Wed Sep 12 14:42:09 UTC 2012

Funny Forkbomb

This shell script is a (single-forking-process) fork bomb in dash and busybox sh, but not in bash and ksh:

#!/bin/sh
S=`yes|head -n 32769`;while :;do exec<<S;done
$S  
S

Why? And why exactly 32769?

There you go.

Actually a neat trick to avoid tempfiles for here-documents, like bash uses...


Posted by OpBaI | Permanent link | File under: unix, shell