CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
telnet using perl program

 



zale1
Deleted

Jun 1, 2001, 10:33 AM

Post #1 of 4 (700 views)
telnet using perl program Can't Post

This has more info than the previous post. (I wish I could delete the previous one, anyway...)

I'm trying to telnet from a solaris 2.7 machine to an AIX 4.3 machine. I am using a perl program to do this. After the first command, the screen just sorta hangs there, until I type control C. Any insight?

The first command is displayed and I assume goes through, but nothing happens unless I press the control C and cancel the process. Then I am returned to my original prompt.

10 $command="telnet aixbox\r\n";$
11 &ExecuteAndPrint ($command);$
12 $command="root\r\n";$
13 &ExecuteAndPrint ($command);$
14 $command="password\r\n";$

The numbers and the dollar signs at the end are just a display in vi text editor. (you probably knew that)

I tried \r\n \n\r \012\015 \012\012\015 \015\012 at the end of the command, from someone's suggestions

Somehow there must be a way to send a command, have the other machine acknowledge it and then have it accept a new command.

when I type a control C (to break out of this) I get messages for each line like this one for the password line

": No such file or directory at zaleudb.pl line 5.
password

zaleudb.pl is the perl program I am executing. The word "password" (changed for security purposes) is the password I tried to send.

Thanks



freddo
User

Jun 2, 2001, 5:29 PM

Post #2 of 4 (691 views)
Re: telnet using perl program [In reply to] Can't Post

Hi Zale,

Maybe you want to check this post it could help you with telnet.

freddo
(wow, now i am referring to myself for answering peoples Smile )

;---
ygjohn: sometimes. you talk too much.. hahaha..


zale1
Deleted

Jun 4, 2001, 9:19 AM

Post #3 of 4 (682 views)
Re: telnet using perl program [In reply to] Can't Post

Thanks...I can telnet, but I'm trying to telnet by sending commands from a perl program. If this is what you did (freddo), could you send me the perl code. (just the first few lines).

My perl program does display the telnet command on the screen, but I need something to tell the machine that the enter/return key has been typed, and to get ready for the second "command" I would be sending, which in this case would be the password.

Thanks



freddo
User

Jun 5, 2001, 5:11 AM

Post #4 of 4 (677 views)
Re: telnet using perl program [In reply to] Can't Post

Hi Zale;

the whole code is aviailable from this previous post if you need help with telnetting with perl; tell me, i'll try to help the best i can.

and please tell us what you want to do, so we can give you examples.

(That was the first time i played with sockets (unless in C))
freddo

;---
ygjohn: sometimes. you talk too much.. hahaha..

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives