Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Attempting to open and pass info to MS Telnet

by saintmike (Vicar)
on Aug 08, 2004 at 03:59 UTC ( #380991=note: print w/replies, xml ) Need Help??

in reply to Attempting to open and pass info to MS Telnet

I guess what you're intending is this: first establish the connection and then you'd like telnet to hand over control to you in interactive mode.

The problem with your approach is that while you might be able to establish the session, you won't be able to jump into the open session interactively. At the end of your script, the session just gets dropped.

If you can't find the file controlling telnet's default settings, I'd probably use Expect for this task . Expect lets you call telnet, waits for its prompt, then lets you send the set localecho command, wait for the prompt again and finally take over the session via Expect's interactive command.

There's a Perl module (Expect) for it, but I'm not sure if it works on Windows. You might want to use the original, Tcl-(gack!)-based Expect version.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://380991]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2022-01-24 11:14 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (64 votes). Check out past polls.