From: Raimon Fs Date: 2009-02-25T16:47:43+09:00 Subject: Re: Can Ruby interact with the shell sh ? > 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. I have to interact with the shell: This is the code I'm using in another language: me.Execute "sh" me.Write "vpnclient connect customer_net user xxxxxxx pwd xxxxxxxxxx"+Chr(13) and then I have to read the answers that are coming from the shell, and when it asks something, write again to it: here I'm waiting for a /y/n) and I have to write to it 'y' (yes), and then the vpn connection is established. I'm not following you with the response = `command` All info that I have is about irb, but I want the unix 'shell' thanks, r. Dim data as String data=me.ReadAll if data.Right(7) = "(y/n): " then me.Write "y"+Chr(13) elseif data.InStr("Your VPN connection is secure") > 0 then connected=True app.print "VPN connection established" end if -- Posted via http://www.ruby-forum.com/.