本文介绍了如何通过ssh发送数据的三管?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个产生于FD = 3,以及对输出和错误可能的一些有趣的数据大量数据的远程主机上的bash脚本。我想:

I have a bash script on a remote host that produces a large amount of data on fd=3 as well as some possibly interesting data on stdout and stderr. I want to:


  1. 请输出和错误,以我的本地机器上的文件。

  2. 写在FD = 3到stdout数据我的本地机器上。

下面是如何,如果我的剧本大都是当地这是可以做到:

Here's how it could be done if my big script were local:


exec 3> >(cat)
./big_script.sh -o /dev/fd/3 2>&1 >big_script.log
exec 3>&-

不过,我想在远程机器上运行big_script.sh,拥有所有三管(FD = 1,FD = 2,FD = 3)来的SSH程序作为独立出来。什么是最好的方式?

However, I want to run big_script.sh on a remote machine and have all three pipes (fd=1, fd=2, and fd=3) come out of the ssh program as separate. What is the best way to that?

推荐答案

NC(netcat的)和隧道?你可以登录还挺广播你的网上这样!

nc (netcat) and tunnels ? you can make kinda log radio on your net this way!

这篇关于如何通过ssh发送数据的三管?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 05:50