Chinaunix

标题: 哪位老大 解释一下 :() { :|:& };: 这条语句的含义,谢谢了。 [打印本页]

作者: hiei1321    时间: 2007-10-19 09:47
标题: 哪位老大 解释一下 :() { :|:& };: 这条语句的含义,谢谢了。
) { :& }; :

哪位老大 解释一下 这条语句的含义,谢谢了。
作者: ivhb    时间: 2007-10-19 09:49
N个人问过,N个人回复过。
你翻翻以前的帖子
作者: auser    时间: 2007-10-19 10:26
这个答案不容易搜到,没有合适的关键词。
作者: hiei1321    时间: 2007-10-19 10:45
助人为快乐之本嘛,知道的就请告诉下,谢谢。
作者: hiei1321    时间: 2007-10-19 11:17
Unix fork bomb
Blogged by webmilhouse as Linux, Security — webmilhouse Fri 1 Dec 2006 8:46 am
Just stumbled across this elegant little fork bomb for Linux/Unix bash shells. Fork bombs perform a local DOS on a machine if the user is not limited to the number forks (usually set in /etc/security/limits.conf on Debian/Ubuntu systems).

From PacketFu blog:

.  () {  .  |  . & } ;  .
0 1  2 3 4 5 6 7 8 9

0 - function name of our newly defined function
1 - parentheses declare a function with no (here optional) arguments
2 - block begins
3 - call self, the newly defined function (recursive)
4 - open a pipe to another process
5 - call self, the newly defined function (recursive)
6 - fork! (put the whole thing in the background)
7 - block ends
8 - end complex statement [ function declaration ]
9 - run that function!

[ 本帖最后由 hiei1321 于 2007-10-19 11:18 编辑 ]
作者: lauren80    时间: 2007-10-19 14:35
wo 塞!
全E文~~还要找广外的同学来翻译一番
作者: cjaizss    时间: 2007-10-19 15:04
:是函数名
:&
重定向,后台
这是递归函数
作者: liaosnet    时间: 2007-10-19 15:04
原帖由 hiei1321 于 2007-10-19 11:17 发表
Unix fork bomb
Blogged by webmilhouse as Linux, Security — webmilhouse Fri 1 Dec 2006 8:46 am
Just stumbled across this elegant little fork bomb for Linux/Unix bash shells. Fork bombs perform ...


声明一个函数"." ,调节函数"."并传送给函数"."并后台执行.  执行函数"."

总体来说.就是一个死循环!
作者: walkerxk    时间: 2007-10-19 18:20
强烈建议网中人写一份道歉书,并且解释这个命令,然后指定。
作者: BLZer    时间: 2007-10-19 18:23
原帖由 liaosnet 于 2007-10-19 15:04 发表


声明一个函数"." ,调节函数"."并传送给函数"."并后台执行.  执行函数"."

总体来说.就是一个死循环!

纯粹的死循环不会耗尽系统资源吧,
他这里是因为在函数体里面执行了两次:函数,
显然每递归调用一次,会fork出2倍的:函数,
所以系统资源很快就会被耗尽啦,
呈n^2次方增加的
作者: 老扁    时间: 2008-01-16 17:49
高手还是很多哦~~
老师出的题目哦~~
好好看看了哦~~
多谢!!!




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2