0

I'm able to send commands and read the stdout of some basic commands:

command = "echo TEST"
(stdin, stdout, stderr) = ssh.exec_command(command)

for line in stdout:
    print(line)

Outputs test.

However, I have tried running some .cmd scripts, and I get no stdout lines. Do I need to be using a different method to receive the terminal output? I made some attempts using the recv method on channel 0, but I think I'm implementing it incorrectly.

Longer term I plan on both reading stdout and sending back commands interactively.

  • Thanks Martin, turned out to be an error with windows path being sent without double backslashes, and therefore the command string being misinterpretted. – Rory McDonald Jun 28 '21 at 14:46

0 Answers0