我想按照下面的顺序做一个管道。数据从nc请求返回。
cat myfile | nc 127.0.0.1 1542 | other_app
问题是cat快速完成,管道停止并且other_app没有被转发。
如何传递other_app从nc返回的数据?
用于发送/接收基本示例:
在接收器中:
nc -l 8080 > tmp.out
在发件人中:
nc 127.0.0.1 8080 < file
如果在接收器中除了写入文件之外你想将输入传递给另一个“应用程序”,你可以使用类似的东西:
nc -l 8080 | tee -a tmp.out | cat