fgimian / paramiko-expect

A Python expect-like extension for the Paramiko SSH library which also supports tailing logs.
MIT License
205 stars 78 forks source link

expect() method assumes '$' as the bash prompt suffix, fails for other flavours of linux such fc19. It would be better to have this as an argument to the method #45

Closed nisarahamedk closed 6 years ago

nisarahamedk commented 6 years ago

Other possible prompts are > and #

fgimian commented 6 years ago

The $ is a regular expression end of line, not a literal.

nisarahamedk commented 6 years ago

But wouldn't the regex fail to match if the prompt ends with characters other than $?

fgimian commented 6 years ago

But wouldn't the regex fail to match if the prompt ends with characters other than $?

Nope, because the $ indicates the end of line, not a literal $.