Unexpected killall behavior
Per the Linux man page killall
won't kill itself.
Edit: I see this isn't mentioned on the OSX man page but it probably has the same behavior. Reason being is that you can use regexps so it's entirely possible you might accidentally try to kill killall
when specifiying a regex, and that would make killall
less useful.
Edit 2: I might be wildly wrong about this, but isn't OSX called "Darwin" - and isn't this the source code to OSX killall
then?
I'm a bit rusty on my C, but the following:
if (thispid == mypid) continue;
in what appears to be a loop iterating through all active processes seems to be a specific check to compare the current process it's trying to kill against it's own PID, so it will skip itself.
Guess you could download that source, remove those two lines, and recompile it if you really wanted a killall
that would kill itself.