From: Adam Gardner Date: 2009-02-25T04:31:43+09:00 Subject: Re: Can Ruby interact with the shell sh ? Raimon Fs wrote: > Hello, > > > I have to establish an VPN connection, currently I'm doing with another > app that can interact with the shell (on OS X), but now I want to > refactor all of this and use Ruby for that. > > What I'm trying is a lot of information about irb but that's not what I > want. > > In pseudo code: > > open a shell promtp > issue a command > read the answer > issue a command > ... > > thanks! > > r. If you just want responses from commands, you can simply use lines like response = `command` On the other hand, if you need to interact multiple times with a program *other* than the shell, during the course of it's runtime, I think you'd want to use IO.popen. -- Posted via http://www.ruby-forum.com/.