Clan x86

Technical (Development, Security, etc.) => Unix / Linux Discussion => Topic started by: iago on August 18, 2005, 07:41:01 pm

Title: Who can tell me what this does?
Post by: iago on August 18, 2005, 07:41:01 pm
I know the answer, of course. 

"kill -9 -1"
Title: Re: Who can tell me what this does?
Post by: Vex3 on August 18, 2005, 07:49:45 pm
I can also tell you... but that would be no fun for everyone else.
Title: Re: Who can tell me what this does?
Post by: Ergot on August 18, 2005, 08:13:09 pm
I don't know what -1 does, but I could take a good guess :P
Title: Re: Who can tell me what this does?
Post by: iago on August 18, 2005, 08:22:50 pm
I don't know what -1 does, but I could take a good guess :P

What would that guess be?
Title: Re: Who can tell me what this does?
Post by: Eric on August 18, 2005, 08:45:33 pm
It closes all processes owned by the user with a process ID greater than 1.  I had to Google the -9, only to find out that it was exactly what I thought it was.
Title: Re: Who can tell me what this does?
Post by: trust on August 18, 2005, 08:47:37 pm
It closes all processes owned by the current user. The -9 is the SIGKILL signal.
Title: Re: Who can tell me what this does?
Post by: iago on August 18, 2005, 09:16:22 pm
Good job!

And can you guess the effect of running it on my laptop before doing "man kill" to find out what -1 does?

Instant lock-up for the current user! Woo! :)

Next, this one's tougher, who can explain to me what this does when run in Bash?
:-(){ :|:& };:

Title: Re: Who can tell me what this does?
Post by: trust on August 18, 2005, 09:21:00 pm
It can't be good cause none of those are smily faces. :( :|
Title: Re: Who can tell me what this does?
Post by: iago on August 18, 2005, 09:22:01 pm
It can't be good cause none of those are smily faces. :( :|

haha

And by the way, _please_ don't try that out on my server if you have access :P
Title: Re: Who can tell me what this does?
Post by: Joe on August 18, 2005, 10:00:45 pm
Alright, thanks for the warning!
Title: Re: Who can tell me what this does?
Post by: Ergot on August 18, 2005, 10:04:00 pm
ergot@darkside:~$ :-(){ :|:& };:

shit :/
Title: Re: Who can tell me what this does?
Post by: Joe on August 19, 2005, 02:52:06 am
Code: [Select]
while (1) {
  fork();
}

Can I do it yet? =)
Title: Re: Who can tell me what this does?
Post by: iago on August 19, 2005, 07:47:21 am
Code: [Select]
while (1) {
  fork();
}

Can I do it yet? =)

That's basically what it does, but how?
Title: Re: Who can tell me what this does?
Post by: Vex3 on August 19, 2005, 09:51:42 am
Since iago gets to give all the puzzle's I will throw some in aswell but iago you can't answer.

I will start these easy and get harder....

ps -ax|more
Title: Re: Who can tell me what this does?
Post by: mynameistmp on August 19, 2005, 03:22:24 pm
Quote
Code:
while (1) {
  fork();
}

Can I do it yet? =)

That's basically what it does, but how?

He won't know unless he can find the log of me explaining it to him last night ;P
Title: Re: Who can tell me what this does?
Post by: iago on August 19, 2005, 03:34:43 pm
Quote
Code:
while (1) {
  fork();
}

Can I do it yet? =)

That's basically what it does, but how?

He won't know unless he can find the log of me explaining it to him last night ;P

Haha, I didn't think he'd figure that out himself :)

To quote somebody else:
Quote
The ':()' defines a fuction ':' with a fuction body of
{
 : | : &
}

As you can see this is a recursive call as the fuction ':' is called,
it's output passed via a pipe as input to the fuction ':' and this
whole command is run in the background '&' .

The last ':' in the string (after the ';') calls the fuction and therefore
starts it all of.

(Krazed edit: Disabled smileys.)