HP3000-L Archives

August 2000, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Mark Bixby <[log in to unmask]>
Date:
Sat, 12 Aug 2000 09:38:38 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (27 lines)
> Curtis Larsen wrote:
>
> Does anyone know of a way to perform *batch* HP3000 client telnet access
> to something?

The following Perl code works in a batch job:

#!/PERL/PUB/perl

$username = 'youruser';
$passwd = 'yourpass';

use Net::Telnet ();
$t = new Net::Telnet (Timeout => 10,
                      Prompt => '/\]\$ $/');
$t->open("yourhost");
$t->login($username, $passwd);
@lines = $t->cmd("/usr/bin/who");
print @lines;

For more info about Net::Telnet (which I have bundled into Perl/iX 5.6.0),
please see:

        http://search.cpan.org/doc/JROGERS/Net-Telnet-3.02/lib/Net/Telnet.pm

- Mark B. (with Perl almost all things are possible)

ATOM RSS1 RSS2