exit command in telnet

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I'm using telnet from a command prompt under WinXP to connect to an embedded
linux target. Part of the target boot sequence involves initiating an exit
from a startup shell, by entering 'exit <enter>'. Telnet interprets this as
terminating the telnet session, the command window returns to a C: prompt.
Is there a way that I can get the session to just pass the exit command
through and hang in? TIA



Re: exit command in telnet
Quoted text here. Click to load it

Like many of Window's command line programs, its telnet client is
somewhat limited - have you tried alternative clients?  If you have a
Linux machine you can use that.  On Windows you could try msys telnet
client (I find Windows unusable until msys is installed to give proper
command-line tools), or Tera Term Pro (which is an excellent serial
terminal emulator, telnet client and ssh client), or perhaps Putty (also
telnet and ssh).


<http://www.mingw.org/wiki/MSYS
<http://ttssh2.sourceforge.jp/index.html.en
<http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html


I can't say for sure whether that will fix your problem - but if these
/real/ telnet clients can't help you, nothing will (short of writing
your own telnet client).


Re: exit command in telnet

Quoted text here. Click to load it


Like many command line telnet clients, if you specify the host on the
command line, when the host disconnects, the default response is to
terminate the telnet program as well.  Some telnet clients allow you
to override that behavior, but the one in Windows is fairly basic.

OTOH, if you run it in command mode (just "telnet"), and then
explicitly open the session ("o hostname"), after the host disconnects
the telnet client will remain active, waiting for another command.

But if your requirement is having the terminal session itself remain
after the "exit", the problem is that it's actually being disconnected
by the host.  Some more sophisticated telnet clients support automatic
logons, and automatic session reconnection, and others allow scripting
(where you could reconnect the session after it disconnects).

Re: exit command in telnet
On Tue, 14 Feb 2012 15:31:17 +0800, Bruce Varley scribbled:

Quoted text here. Click to load it

I find, using the simple client provided by Microsoft, that if you DON'T
specify the host name/IP address on the command line that an exit from
the target does not cause the client to terminate.

i.e.
telnet
then enter OPEN <hostname> <port>
diddle as needed
exit
and you're back in the telnet client

Regards
--
Quoted text here. Click to load it
Bill Dennen             snipped-for-privacy@hotmail.com
We've slightly trimmed the long signature. Click to see the full one.
Re: exit command in telnet
Quoted text here. Click to load it

The Telnet client doesn't do zip with the 'exit' command but the host does:
it terminates the connection, which in turn makes Telnet either exit or go
back to its own command prompt, depending on how you invoked telnet as Bill
says.

Meindert



Site Timeline