This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes can I run telnet thru a java program? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "can I run telnet thru a java program?" Watch "can I run telnet thru a java program?" New topic
Author

can I run telnet thru a java program?

vikram kulkarni
Greenhorn

Joined: Feb 14, 2000
Posts: 1
can I run telnet thru a java program?
i need to login to a unix server and run a script. this script would run some unix commands (e.g date, who etc.) and redirect this to a file on the unix server. my program should then be able to read this file.
thanks
vicky
Dave Smith
Greenhorn

Joined: Jan 12, 2000
Posts: 23
I would imagine this would work. You would need to connect via a URLConnection prehaps, then wait until you read the login information from the socket. Then write the stuff to login, and basically control the whole session as if you were typing it yourself.
BTW, you can use the "cat" command to put the contents of the file you have just written to the socket.
Hope this helps.
Dave Smith
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can I run telnet thru a java program?