As Adam suggested, you could use a pipe. Open a pipe to the program in
read-write mode, so you can read from it and write to it. A simple
example:
IO.popen('./some_command', 'r+') do | pipe |
while line = pipe.gets do
puts " ** #{line}"
if line =~ %r{y/n}
pipe.puts 'y'
end
end
end
But he was referring using a pipe if the program was *other* than the
shell, and I want to interact with the shell.
In other environments I have specific command to open an interactive
shell like me.Execute("sh") and so on ...
Here is what I want to do in a terminal shell:
The vpnclient is a command, not an application with a double-click
approach.
thanks again for your time!
regards,
r.
MontxMacBookPro:~ montx$ vpnclient connect xxxxxxx user xxxxxxxx pwd
xxxxxxxxx
Cisco Systems VPN Client Version 4.9.01 (0100)
Copyright (C) 1998-2006 Cisco Systems, Inc. All Rights Reserved.
Client Type(s): Mac OS X
Running on: Darwin 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24
17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386
Config file directory: /etc/opt/cisco-vpnclient
WARNING:
Using the "pwd" option may allow other users
on this computer to see your password.
Initializing the VPN connection.
Contacting the gateway at xxx.xxx.xxx.xxx
Authenticating user.
Negotiating security policies.
Securing communication channel.
============== WARNING ================
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
========================================
Do you wish to continue? (y/n): y
Your VPN connection is secure.
VPN tunnel information.
Client address: 10.10.10.1
Server address: xxx.xxx.xxx.xxx
Encryption: 168-bit 3-DES
Authentication: HMAC-SHA
IP Compression: None
NAT passthrough is active on port xxxxxxxxxxxx
Local LAN Access is disabled