从管道转发数据

问题描述 投票:0回答:1

我想按照下面的顺序做一个管道。数据从nc请求返回。

cat myfile | nc 127.0.0.1 1542 | other_app

问题是cat快速完成,管道停止并且other_app没有被转发。

如何传递other_app从nc返回的数据?

linux cat netcat
1个回答
0
投票

用于发送/接收基本示例:

在接收器中:

nc -l 8080 > tmp.out

在发件人中:

nc 127.0.0.1 8080 < file 

如果在接收器中除了写入文件之外你想将输入传递给另一个“应用程序”,你可以使用类似的东西:

nc -l 8080 | tee -a tmp.out | cat
© www.soinside.com 2019 - 2024. All rights reserved.