问题
I would like to query a telnet server on port 105. What I have to do currently is start an interactive session and enter the commands later one by one.
Since I already know the commands, I would like to automate this process and fetch the results without any manual intervention.
When I try to use pipe to push commands at the time of logging in, this doesn't work. Any help is highly appreciated.
回答1:
You are probably looking for a tool like expect.
回答2:
Since you do not say what OS you use, and what kind of script language you want to use I will just provide a few suggestions for further reading.
this questions might answer what you are looking for.
Also I found this that could help you out a bit.
来源:https://stackoverflow.com/questions/13340530/how-to-automate-interactive-telnet-commands