如何自动执行交互式telnet命令? [英] How to automate interactive telnet commands?

查看:314
本文介绍了如何自动执行交互式telnet命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查询端口105上的telnet服务器.当前,我要做的是启动一个交互式会话,然后逐个输入命令.

由于我已经知道这些命令,因此我想自动执行此过程并获取结果,而无需任何人工干预.

当我尝试在登录时使用管道推送命令时,此操作无效.任何帮助都将受到高度赞赏.

解决方案

您可能正在寻找类似 expect 的工具

a>.

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.

解决方案

You are probably looking for a tool like expect.

这篇关于如何自动执行交互式telnet命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆