~ubuntu-branches/ubuntu/wily/libnet-openssh-perl/wily-proposed

« back to all changes in this revision

Viewing changes to sample/net-telnet.pl

  • Committer: Package Import Robot
  • Author(s): Florian Schlichting
  • Date: 2012-02-22 23:35:55 UTC
  • Revision ID: package-import@ubuntu.com-20120222233555-j839vhem3058ewpx
Tags: upstream-0.57
ImportĀ upstreamĀ versionĀ 0.57

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use strict;
 
4
use warnings;
 
5
 
 
6
use Net::OpenSSH;
 
7
use Net::Telnet;
 
8
 
 
9
$Net::OpenSSH::debug = -1;
 
10
 
 
11
my $ssh = Net::OpenSSH->new('localhost');
 
12
my ($fh, $pid) = $ssh->open2pty();
 
13
my $conn = Net::Telnet->new(Fhopen => $fh);
 
14
my @lines = $conn->cmd("find /tmp");
 
15
print @lines;
 
16
my @lines1 = $conn->cmd("ls");
 
17
print "\n\nls:\n", @lines1;