From: "Henry T. So Jr." Date: 2001-11-07T20:42:46+09:00 Subject: [ruby-talk:24500] Re: Doing both input and output to a process > Say I wanted to run a shell, send it commands and catch the output from > them. > > How can I do that in Ruby? I've tried a number of access modes to popen > and also tried running a separate thread, setting up a couple of pipes > and setting $defin and $defout, but can't seem to get it right. > > Any suggestions? > > Use the pty extension (it is included with Ruby at least since 1.6.3). You might also try open3 (in open3.rb), but I've had less success with that. Henry.