【问题标题】:Pass argument into telnet in Bash在 Bash 中将参数传递给 telnet
【发布时间】:2023-01-21 02:44:10
【问题描述】:

你如何使用 bash 在 telnet 中传递参数。当我试图推动时,我不断收到错误消息。

输入

echo "status" | telnet localhost 5555 > /tmp/text.txt

输出

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

我期待输出重定向到一个文件进行解析,但是我收到了一个错误。

【问题讨论】:

  • 您可能想使用 nc 而不是 telnet。
  • 您所看到的内容已写入 stderr。我没有看到任何错误指示
  • 请编辑您的问题以显示文件/tmp/text.txt 中是否有消息。祝你好运。

标签: linux bash telnet


【解决方案1】:

Telnet 不能做你想做的事。请参阅此 posting 中的完整说明。

【讨论】:

    猜你喜欢
    • 2017-07-22
    • 2021-10-05
    • 2018-05-22
    • 1970-01-01
    • 1970-01-01
    • 2021-11-25
    • 2021-11-18
    • 2012-12-29
    相关资源
    最近更新 更多