Thanks for the reply John. I actually ended up doing what you suggest but
now I am just curious as to what was wrong.

Thanks
Mike

John Losey <[EMAIL PROTECTED]> on 09/12/2000 12:59:17 PM

Please respond to [EMAIL PROTECTED]

To:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject:  RE: [OT] Perl Telnet script




Have you considered having your perl script use an rsh (or its equivalent
with SSH, which plugs the security holes inherent in the Berkley commands
[aka "r" commands])?  I've never tried scripting telnet stuff through Perl,
but some of the others here have used Expect for similar FTP type of
things.

John

The opinions expressed herein are those of the User and not HBSI.  No
warrantee, expressed or implied, can be construed from advice given or
statements made in this e-mail.


-----Original Message-----
From: Michael Butler/CanEast/IBM [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 12, 2000 5:28 AM
To: [EMAIL PROTECTED]
Subject: [OT] Perl Telnet script



Sorry for the off topic question but I'm scratching my head here. I've
written a perl script to do a telnet to a server and run an arbitrary
command. Doing a "who" on the server indicates that I do indeed get
connected. However, after the specified timeout I get "connection timed out
waiting for a command prompt". Here's my code:

#!/usr/bin/perl
use Net::Telnet;
$telnet = Net::Telnet->new
(
 Timeout=>10, Prompt=>'/[\$%#>] $/', Host=>'berkeley'
 );
$telnet->login('mbutler', 'xxxxx');
@listing = $telnet->cmd("ls");
print @listing;
$telnet->close;

Anyone got any ideas?

Thanks
Mike



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list





_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to