in reply to Re^14: Net::OpenSSH loosing lines ins reply
in thread Net::OpenSSH loosing lines ins reply
#!perl -w use strict; use warnings; use Data::Dumper; use Net::OpenSSH; my $sshuser="user"; my $sshpwd="pwd"; my $device = $ARGV[0]; my $sshcmd = $ARGV[1]; my $error; my $ssh; my $path = "./Y.ssh"; $ssh = Net::OpenSSH->new( $device, user => $sshuser, passwd => $sshpwd, ctl_dir => $path, master_opts => [-o => "StrictHostKeyChecking=no", -o => "UserKnown +HostsFile=/dev/null"], strict_mode => 0, master_stderr_discard => 1 # to get rid of login screen ); my @cmdout; my @cmdout2; @cmdout2 = $ssh->capture({stdin_data => "\n"}, $sshcmd."\n"); open FILE, "<", "./rawout.txt"; @cmdout = <FILE>; close(FILE); $ssh->master_exited; foreach (@cmdout) { print $_; } exit 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^16: Net::OpenSSH loosing lines ins reply
by salva (Canon) on Jun 04, 2014 at 17:47 UTC | |
by Andy16 (Acolyte) on Jun 04, 2014 at 19:23 UTC | |
by Andy16 (Acolyte) on Jun 05, 2014 at 06:18 UTC | |
by salva (Canon) on Jun 05, 2014 at 08:55 UTC | |
by Andy16 (Acolyte) on Jun 05, 2014 at 09:28 UTC | |
|