我目前正在使用 Exscript 将 ssh 连接到我拥有的控制器中。我正在尝试使用 execute() 函数向它发送命令,并且在我使用 send() 函数之前它一直有效。之后当我尝试使用 execute() 函数时,我会收到超时错误或找不到命令错误。以下是代码示例:
conn.execute('ls')
if a:
conn.send('0')
elif b:
conn.send('')
conn.execute('ls')
和错误:
Exscript.protocols.exception.TimeoutException: Timeout while waiting for response from device
Exscript.protocols.exception.InvalidCommandException: Device said:
0ls
-sh: 0ls: command not found
我不知道如何解决这个问题。