7 use lib "$FindBin::Bin/../lib";
11 my ($status, $cmd, @output);
13 my $hostname = $ENV{HOST} || 'localhost';
14 my $username = $ENV{USERNAME};
15 my $password = $ENV{PASSWORD};
17 my $remote = Rexec->new (
19 username => $username,
20 password => $password,
25 print "Connected to $username\@$hostname using "
26 . $remote->{protocol} . " protocol\n";
28 $cmd = "/bin/ls /nonexistent";
30 @output = $remote->execute ($cmd);
31 $status = $remote->status;
33 print "$cmd status: $status\n";
37 print "$_\n" foreach ($remote->execute ('cat /etc/passwd'));
39 print "Unable to connect to $username@$hostname\n";