kerzner
asked on
How to I run a small Telnet script in Linux from Java and get back the result?
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
kyleb84, the reason I am going this way is because Telnet, when I use it standalone, did work properly. My Java code did not. So I plan to wrap the use of Telnet. I will try your approach if ExpectJ does not work out.
ASKER
basav_com,
it sounds like what I need, and I will use it first thing tonight. I vaguely remember having used Unix expect with good results.
it sounds like what I need, and I will use it first thing tonight. I vaguely remember having used Unix expect with good results.
You want this to be a non-interactive procedure?
You'll need a java Telnet client, there's plenty around - then you need to gut it and take out the Telnet protocol handling.
Then you'll need to add on to that class providing automated read/write functions for your application.
It's a fair bit of work but possible.
For a start, here's a Telnet/SSH client in java, source code available.
http://javassh.org/space/start