O
Oddly Zen
Hello, all--
I am trying to interact with a command-line application on a remote
machine using Net::SSH and trying to figure out how to send data to
the application after invoking it. My code is somewhat like this:
?> ssh.exec './solve -iy -c /path/to/config/file' do |ch, stream,
data|
?> if stream == :stderrorenvironment variable PV_VRESULTS_LIMIT not set
bb
bd
bh
br
ch
fb
fl
ja
jh
li
ma
mm
nn
op
pp
ps
rh
rp
rw
sb
wb
....
Now, at this point, I need to send 'li' to the server to select which
case to run. After that, the command-line application will query me
with other options that I need to respond to and send across the wire.
My question is this:
How do I send the data once the application is invoked on the remote
machine, wait for the response (checking that against possible
responses), then send more data, and repeat until all the options are
sent, until I get the final output from the application?
Any help is greatly appreciated, as my head is starting to bleed from
banging it against my desk for the past couple hours... =/~
--Mark
I am trying to interact with a command-line application on a remote
machine using Net::SSH and trying to figure out how to send data to
the application after invoking it. My code is somewhat like this:
?> ssh.exec './solve -iy -c /path/to/config/file' do |ch, stream,
data|
?> if stream == :stderrorenvironment variable PV_VRESULTS_LIMIT not set
bb
bd
bh
br
ch
fb
fl
ja
jh
li
ma
mm
nn
op
pp
ps
rh
rp
rw
sb
wb
....
Now, at this point, I need to send 'li' to the server to select which
case to run. After that, the command-line application will query me
with other options that I need to respond to and send across the wire.
My question is this:
How do I send the data once the application is invoked on the remote
machine, wait for the response (checking that against possible
responses), then send more data, and repeat until all the options are
sent, until I get the final output from the application?
Any help is greatly appreciated, as my head is starting to bleed from
banging it against my desk for the past couple hours... =/~
--Mark