From: Brian Candler Date: 2009-02-26T03:01:59+09:00 Subject: Re: Can Ruby interact with the shell sh ? Adam Gardner wrote: > See, this is what I was referring to when I said a program other than > the shell. You're using the shell here, but you almost certainly don't > need to be. The program whose output you actually care about if not > /bin/sh, but /usr/local/bin/vpnclient > > So, you could change your code in this way: > > IO.popen("/usr/local/bin/vpnclient connect xxxxx user xxxxxxx pwd > xxxxxxxxxx","r+") do |s| Aside: as far as a I remember, IO.popen invokes a shell anyway and passes that command to it. With Kernel#system there is a multi-arg version which bypasses the shell: system("/usr/local/bin/vpnclient","connect",xxxx, ... etc) I don't think you can do this with IO.open - but you can with open3 (see open3.rb in the standard library) -- Posted via http://www.ruby-forum.com/.