【问题标题】:How to display or capture full output of "Execute command" of SSHLibrary?如何显示或捕获 SSHLibrary 的“执行命令”的完整输出?
【发布时间】:2018-10-01 07:43:12
【问题描述】:

我在使用 SSH 执行命令时遇到问题。

我的要求:1. 使用 IP 开启 ssh 连接(例如:125.230.200.80)

登录 ssh [文档] 连接到 SSH 并登录关闭所有连接打开连接 ${SSH_IP} 端口=22 超时=10 登录 ${USERNAME} ${PASSWORD} 延迟=10 秒

  1. 我想在该服务器的特定目录中执行命令。目录:/export/home/IKBAL/Simulator 命令:./send 1 1 hostsocket S 我在comamnd下面使用过 执行命令 /export/home/IKBAL/Simulator/./send 1 1 hostsocket S

    如何查看完整的命令输出或将命令输出存储在文件中?

【问题讨论】:

    标签: ssh robotframework robotframework-sshlibrary


    【解决方案1】:

    您要查找的是 Execute Command 的返回值,例如使用这个结构:

    ${output}=    Execute Command    /export/home/IKBAL/Simulator/./send 1 1 hostsocket S
    

    ${output} 的值将是send 命令的标准输出。然后你就可以把它当作任何普通的 Robotframework 变量来使用了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多