in reply to Re^8: SSH to remote subsystem (Net::OpenSSH?)
in thread SSH to remote subsystem (Net::OpenSSH?)
## SEND THE QUERY FOR THE CONFIG $message = qq~ <?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <get-config><source><running/></source></get-config> </rpc> ]]>]]>~; print $out $message; close $out; ## PRINT THE RESULTS while (<$in>) { print; last if $_ =~ m/\/nf:rpc-reply/; } close $in; waitpid( $pid, 0 ); exit;
If I wanted to keep the $out pipe open so that further messages could be sent is there some sort of flush (I assume this is what you expected the newline to do) that could be used? I looked at the Net:OpenSSH docs in the open_ex section but dont see anything that suggests this can be done.
If this is not possible should I close and recreate the open_ex for every req/res I send?
Thanks for the prompt response, apologies if the questions are naive, perl newbie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: SSH to remote subsystem (Net::OpenSSH?)
by salva (Canon) on Sep 10, 2014 at 15:22 UTC | |
by alrighttheresham (Initiate) on Sep 10, 2014 at 18:54 UTC | |
by salva (Canon) on Sep 11, 2014 at 11:57 UTC | |
by alrighttheresham (Initiate) on Sep 11, 2014 at 14:27 UTC |