Net::Telnet help please 
Author Message
 Net::Telnet help please

Hi

I am very new to Perl. I want to write a script that would connect to a
remote host using Telnet. I installed the Net::Telnet module in my own
directory, and use the following script to test:

#!/usr/bin/perl -w

use lib '/home/stude/s/ssham/lib/perl';

use Net::Telnet ();

$username='MYLOGIN';
$passwd='MYPASSWORD';

$t = new Net::Telnet (Timeout => 10,
                      Prompt => '/bash\$ $/');
$t->waitfor('/continue:.*$/');
$t->open("HOSTNAME");



But I've got an error message saying:

Quote:
>timed-out waiting for command prompt at try10 line 16

I suspect that my Prompt variable is not right. However, I know that the
host I am trying to connect to is using bash. My question is:

1) What can I do to make this script work?
2) What other choices are there, instead of '/bash\$ $/', is there any
other string that I can try?

Thanks

Sanford



Sat, 15 Feb 2003 09:32:02 GMT  
 Net::Telnet help please

Quote:

> Hi

> I am very new to Perl. I want to write a script that would connect to a
> remote host using Telnet. I installed the Net::Telnet module in my own
> directory, and use the following script to test:

> I suspect that my Prompt variable is not right. However, I know that the
> host I am trying to connect to is using bash. My question is:

> 1) What can I do to make this script work?
> 2) What other choices are there, instead of '/bash\$ $/', is there any
> other string that I can try?

Why not telnet to the system (from the command line) and see what the
prompt is?  Then put that prompt into your code.

--
Paul Andersen
+++++++++++++
The difference between theory and practice is that in theory there is no
difference between theory and practice; but in practice there is.



Sat, 15 Feb 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Net::Telnet help please

2. REAL Net::Telnet Problem Please Help

3. Please Help With Net::Telnet Login Prompt

4. Net::Telnet-ing problem to Solaris telnet server

5. Net::Telnet 3.03: drain a telnet buffer

6. Telnet-Client with Net::Telnet

7. Telnet cmd, Net::Telnet

8. keeping Telnet alive with Net::Telnet

9. Net::Telnet -like module without telnet

10. Need help with Net::Telnet

11. Net::Telnet help

12. Help: fork() and Net::Telnet

 

 
Powered by phpBB® Forum Software