I've got code somebody else wrote. The code uses exec() to invoke
shell processes. It spawns zombies by the thousands.
I need to redo this over the long term to stop using shell processes at all.
I need it to stop spawning zombies immediately.
This blog post gives six ways to invoke a shell process:
http://pasadenarb.com/2007/03/ruby-shell-commands.html
How do I choose which of these six methods to use?
All I remember off the top of my head is that backticks is the most
terse and system() is the one I use the most. I had forgotten exec()
even existed. "The Ruby Way" says that exec() doesn't use a subshell
and system() does. I think that's *why* I forgot exec() existed - I
think I blacklisted the method from the moment I discovered it.
I'm switching the legacy code to use system(). Way too much
superstition and guessing in this process for my taste though. How do
you choose the best (least zombie-prone) method to invoke a shell
process?