我已经声明了一个变量命令的值
command =4
stdin, stdout, stderr = ssh.exec_command("pwd; ./test.sh command")
当我尝试运行上述命令时,将输出显示为
I am command
但它应该返回为
I am 4
以上命令中缺少语法吗?
提前致谢
您将“ command”作为字符串传递,但是您需要将其值作为字符串传递:
ssh.exec_command("pwd; ./test.sh " + str(command))
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句