Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PythonFabric:在远程服务器上执行诸如less之类的交互式程序?_Python_Fabric_Less Unix - Fatal编程技术网

PythonFabric:在远程服务器上执行诸如less之类的交互式程序?

PythonFabric:在远程服务器上执行诸如less之类的交互式程序?,python,fabric,less-unix,Python,Fabric,Less Unix,当我执行以下操作时: run('less <somefile>') 但是,我不确定这是否是推荐的,因为我觉得这可能会对远程资源造成负担,因为cat将不断通过ssh管道返回。另外,当我在整个文件被cat'd(可能超过1GB)之前使用quick less时,我会得到一个代理管道错误 建议采用什么方式来促进这一点?我应该直接使用ssh吗 ssh <remote host> less <something> ssh-less 如果您在远程主机上执行交互式工作,那么

当我执行以下操作时:

run('less <somefile>')
但是,我不确定这是否是推荐的,因为我觉得这可能会对远程资源造成负担,因为cat将不断通过ssh管道返回。另外,当我在整个文件被cat'd(可能超过1GB)之前使用quick less时,我会得到一个代理管道错误

建议采用什么方式来促进这一点?我应该直接使用ssh吗

ssh <remote host> less <something>
ssh-less

如果您在远程主机上执行交互式工作,那么可能只使用SSH就可以了。我认为fabric在自动化操作时最有用。

作为一种更新,运行local('ssh-t less')似乎工作得很好
fab less | less
ssh <remote host> less <something>