File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Need to exit from telnet after connecting via shell script Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Reply Bookmark "Need to exit from telnet after connecting via shell script" Watch "Need to exit from telnet after connecting via shell script" New topic
Author

Need to exit from telnet after connecting via shell script

Binesh Veetil
Greenhorn

Joined: Jan 21, 2012
Posts: 9
Hi,

I am doing a telnet to a remote IP via a shell script. Is there a cmd in shellscript wherein I can exit from telnet session and also is there a way to set the timeout?

Thanks,
BV
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

Setting the user timeout in Linux is a bit tricky. I'd have to google for details myself.

The exit from telnet is simple, though. It's simply end-of-file. If you're running a telnet session from a script, the end of the stdin stream will disconnect. For interactive sessions, type Ctrl-D, just as you would to logout.

One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
 
IntelliJ Java IDE
 
subject: Need to exit from telnet after connecting via shell script
 
Threads others viewed
Output of telnet task
URGENT !! How can a shell script get the System.exit() exit value?
Current directory not in path when logging via ssh
sftp
Runtime.getRuntime().exec() from JSP page
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture