[英]stty: standard input: Invalid argument when using pdsh or ssh
I want to run a simple script from remote machine. 我想从远程机器运行一个简单的脚本。 The script contains the following:
该脚本包含以下内容:
#!/usr/bin/python
import os
print str(os.popen('stty size', 'r').read())
If I run it from local machine I get fine output, something like 36 138
. 如果我从本地机器运行它,我会得到很好的输出,如
36 138
。 If I try to run it from another machine, I get <ip>: stty: standard input: Invalid argument
(using ssh ot pdsh). 如果我尝试从另一台机器运行它,我得到
<ip>: stty: standard input: Invalid argument
(使用ssh ot pdsh)。
The problem is I can't change the script that is using the stty command. 问题是我无法更改使用stty命令的脚本。 This is a common script, which I write wrapper to.
这是一个常见的脚本,我编写了包装器。 Suggestions ?
建议?
As BroSlow said, ssh -t
will solve the problem if using ssh
. 正如BroSlow所说,如果使用
ssh
, ssh -t
将解决问题。
If using pdsh
via ssh
, I used the following: 如果通过
ssh
使用pdsh
,我使用以下内容:
export PDSH_SSH_ARGS_APPEND="-tt -q"
pdsh -w ${machine_list} -S -R ssh ${cmd}
PDSH_SSH_ARGS_APPEND
is used to append arguments to the ssh command generated by the pdsh
, as the name hints. PDSH_SSH_ARGS_APPEND
用于将参数附加到pdsh
生成的ssh命令,如名称提示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.