in reply to Call external script via ssh with Control::CLI, get output to calling script window
Disclaimer: I haven't used Control::CLI before.
With '->cmd()' it seems like you can't. But the documentation says '->cmd()' is equivalent to
$obj->read(Blocking => 0); $obj->print($cliCommand); $output = $obj->waitfor($obj->prompt);
so you may be able to replace the call to cmd() with something like this:
This code fragment is totally untested. I just wanted to give you an idea.$obj->read(Blocking => 0); $obj->print($cliCommand); while (not $obj->prompt) { my $inc_output = $obj->read(Blocking => 0); if (defined $inc_output) { print $inc_output; $s1_output .= $inc_output; } sleep 1; } (process output in $s1_output)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Call external script via ssh with Control::CLI, get output to calling script window
by ImJustAFriend (Scribe) on Jul 29, 2015 at 09:10 UTC | |
by lgas (Acolyte) on Mar 13, 2016 at 13:12 UTC |