sqspat has asked for the wisdom of the Perl Monks concerning the following question:
my $exp = new Expect; #commands below are not being sent to the local machine command line a +nd not sure why not? $exp->send("ssh root\@device203 install license < input/Licence321178. +lic\r"); print "$exp\n"; sleep(1); $exp->send("admin\r"); sleep(1); # This next section uses Expect and SSH successfully my $ssh = Net::SSH::Expect->new ( host => "$host_details[1]", user => 'root', password => 'admin', raw_pty => 1, timeout => 1 ); #eval { my $login_output = $ssh->login(); if ($login_output !~ /loginprompt/) { die "Login has failed. Login output was $login_output"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: mixing perl expect ssh and local commands
by Sewi (Friar) on Sep 03, 2009 at 12:14 UTC |