Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: telnet login script from W2K to unix box

by dfaure (Chaplain)
on Jul 28, 2004 at 09:37 UTC ( #377976=note: print w/replies, xml ) Need Help??


in reply to telnet login script from W2K to unix box

...run a few commands at the command line (change shell, setenv etc)and then continue working on the unix box. How do I break out of the script on the remote machine?

Your Net::Telnet script is seen by your host as a single telnet access to it. When the script ends, the network connection is close and the host session is lost (login shell terminated).

  • The first solution I see is to drive a real telnet client, feeding it with your commands from a script.
  • Depending on the Perl distrib you have, you may also use Expect.
  • You may even write your own terminal emulator, replacing the sleep 2; pause with a (quasi-)infinite loop waiting for an input, sending it and displaying the output back to you.

You might also have other solutions involving a specific configuration of the pseudo-terminals of your destination host, but they are beyond my knowledge of the Unix system.

____
HTH, Dominique
My two favorites:
If the only tool you have is a hammer, you will see every problem as a nail. --Abraham Maslow
Bien faire, et le faire savoir...

  • Comment on Re: telnet login script from W2K to unix box

Replies are listed 'Best First'.
Re^2: telnet login script from W2K to unix box
by paddyo (Initiate) on Jul 29, 2004 at 14:29 UTC
    I didn't think there was an Expect Module for windows?????

      According to pod, it "runs" on the perl's cygwin distribution which provides terminal emulation à la Unix.

      Anyway, using PuTTY and Win32::GuiTest you may be able to drive your telnet session as you like.

      ____
      HTH, Dominique
      My two favorites:
      If the only tool you have is a hammer, you will see every problem as a nail. --Abraham Maslow
      Bien faire, et le faire savoir...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://377976]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2018-08-15 22:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (165 votes). Check out past polls.

    Notices?