This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can I run telnet thru a java program?

 
vikram kulkarni
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic