Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: perl expect

by salva (Abbot)
on Sep 16, 2013 at 07:38 UTC ( #1054241=note: print w/replies, xml ) Need Help??

in reply to perl expect

use Net::OpenSSH;
... my ($host, $user, $password, @cmds) = split ',', $line; my $ssh = Net::OpenSSH->new($host, user => $user, password => $passwor +d); if ($ssh->error) { print STDERR "Unable to log into remote host: ".$ssh->error; next; } print "HOST: $host\n\n" for my $cmd (@cmds) { my ($out, $err) = $ssh->capture2($cmd); print "CMD: $cmd\nRC: $?\nSTDOUT:\n$out\nSTDERR:\n$err\n\n\n"; }
Consider also using some CPAN module to parse the CSV files (i.e. Text::CSV). That way you will be able to handle files with quoted fields inside correctly.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1054241]
[zentara]: Strange, on clicking a link in a node, I am taken to that node, but my votes and login are lost. Should I post a Permonks Discussion?
[choroba]: that just means someone used a wrong link format
[choroba]: msg them or consider to fix
[zentara]: Gratias
[LanX]: pm != tk ;)
[Corion]: zentara: Most likely they used something like [http://www. node=123456] instead of [id://123456], which uses whatever domain you're visiting from
[LanX]: hmm... Actually this could be used for a phishing exploit ...
[LanX]: ... well like always :)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2017-05-26 12:36 GMT
Find Nodes?
    Voting Booth?