,_,( ){ ,_,| ,_,&};,_,
I am not sure what it means...
Looks like a bash command but it might be s bash shell directive or something would appreciate if someone can help understand this. It killed my bash when I ran it.
bash is a sh-compatible command language interpreter that executes commands read from the standard input or from a file. bash also incorporates useful features from the Korn and C shells (ksh and csh).
It turns out, $() is called a command substitution. The command in between $() or backticks (“) is run and the output replaces $() . It can also be described as executing a command inside of another command.
$_ (dollar underscore) is another special bash parameter and used to reference the absolute file name of the shell or bash script which is being executed as specified in the argument list. This bash parameter is also used to hold the name of mail file while checking emails. $@
$# is a special variable in bash , that expands to the number of arguments (positional parameters) i.e. $1, $2 ... passed to the script in question or the shell in case of argument directly passed to the shell e.g. in bash -c '...' .... .
It's a fork bomb; it will spawn a (potentially) infinite number of processes, until your system runs out of resources (and usually becomes inoperable).
It defines the function named ,_,
, which runs itself (recursion), and piping the output to itself. The last ,_,
is needed to start off the thing.
Formatted, and with ,_,
replaced by fun
, it looks like:
fun() {
fun | fun &
};
fun
Every invocation of fun
will spawn 2 more invocations of fun
. The &
starts the processes in the background (rate of process increase is exponential).
It's a variant of the better known :() { :|: & };:
There are ways to prevent your system from crashing, though; for example in Linux you can edit /etc/security/limit.conf
& set the maximum number of processes for a user. Other systems have other (usually similar) methods.
Running a fork bomb and crashing your system seems to be something of a rite of passage for UNIX users; it teaches you:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With