Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nelly22

macrumors 6502
Original poster
Sep 29, 2009
366
5
Is there any way to keep unix "kill" running all the time so when my .sh script tells to kill some process, it's already in RAM-memory and runs little bit faster?
 

chown33

Moderator
Staff member
Aug 9, 2009
10,776
8,481
A sea of green
Is there any way to keep unix "kill" running all the time so when my .sh script tells to kill some process, it's already in RAM-memory and runs little bit faster?
Please explain why you think this is a worthwhile way to gain speed. What shell are you running? How much extra speed do you need, or think you need?

Unless you're running on a spinning hard disk, and it's spun down, the delay to run '/bin/kill' will be insignificant. If your script is looping, the first time it runs it'll be loaded into the disk cache. Thereafter, it will be present in cache and loaded from there.

Furthermore, 'kill' is a bash builtin, so when you run it as 'kill' (as distinct from '/bin/kill') it's already "in RAM" and will already run as fast as it possibly can.

To show that 'kill' is a bash builtin, type this command in a Terminal window:
Code:
type kill
 

andy89

macrumors 6502
May 22, 2005
316
114
Kent, England
What chown33 said. And if you want to squeeze a little bit more out of your scripts I suggest you use ksh, which has a more complete set of builtins.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.