2

I'd like to use paramiko to run a command and exit when a pattern appears. Now I do it using pexpect.expect(..., pattern = [pattern1, pattern2,...])

Is there a way to do using paramiko?

Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254
Ofer Helman
  • 714
  • 1
  • 8
  • 25

1 Answers1

2

No, I don't think paramiko has that capability. In my experience the best approach is to send the pexpect script to the remote and execute it there with your paramiko. Fabric users run into this issue sometimes: https://stackoverflow.com/a/10007635/708221

Community
  • 1
  • 1
Jasper van den Bosch
  • 3,169
  • 4
  • 32
  • 55