-1

How can I use one SSH object to execute two commands one after the other? can I use the ";" between the commands when sending them? i.e : stdout = ssh.exec_command('command1';'command2')

Elias Shourosh
  • 69
  • 3
  • 14
  • *"can I use the ";""* - Yes you can (assuming your server understand that syntax). Why don't you try? – Martin Prikryl May 17 '18 at 07:03
  • Possible duplicate of [Execute multiple commands in Paramiko so that commands are affected by their predecessors](https://stackoverflow.com/questions/49492621/execute-multiple-commands-in-paramiko-so-that-commands-are-affected-by-their-pre) – Martin Prikryl May 17 '18 at 07:04
  • @MartinPrikryl - will do now. Thanks – Elias Shourosh May 17 '18 at 07:11

1 Answers1

2

It's not

ssh.exec_command('command1' ; 'command2')

Should be

ssh.exec_command('command1 ; command2')