How do I call shell commands from inside of a Ruby program? How do I then get output from these commands back into Ruby?
Here's a flowchart based on "When to use each method of launching a subprocess in Ruby". See also, "Trick an application into thinking its stdout is a terminal, not a pipe".