gpt4 book ai didi

pipeline - 为什么管道内容到命令 nc 不起作用?

转载 作者:行者123 更新时间:2023-12-02 09:12:19 29 4
gpt4 key购买 nike

我尝试使用nc从shell获取zookeeper统计信息,

首先调用nc localhost 2181,然后输入:stat有效。

回显“stat” | nc localhost 2181 什么也不返回。

为什么?

最佳答案

在 Zookeeper 邮件列表中问了同样的问题,得到了这个:

Most probably you are using the wrong "nc" command.

Not kidding :P there are two different "nc" packages, and the syntax is different betweem then. In debian-like distros they are netcat-openbsd and netcat-traditional, but I ran into the same problems with netcat in CentOS (I can't remember the name of the packages, sorry) until I realized I was using it wrong.

--Tomas Nunez

我发现我的服务器上的nc是nc.openbsd,安装nc.traditional后,

回显“stat”| nc.传统 10.18.10.30 2181

返回预期结果。

关于pipeline - 为什么管道内容到命令 nc 不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21846617/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com