Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcoded $ in re_string #47

Closed
rymkapro opened this issue Nov 29, 2018 · 4 comments
Closed

Hardcoded $ in re_string #47

rymkapro opened this issue Nov 29, 2018 · 4 comments

Comments

@rymkapro
Copy link

rymkapro commented Nov 29, 2018

Hi!
I'm running Centos and there is no $ symbol in prompt, it has # instead.
In other operations, e.g. changing user password, there are no symbols ($, #) at all.

So, may be it should better not to include such symbols in re_strings in expect method?

After I've removed + '$' everything works fine.

@rymkapro
Copy link
Author

rymkapro commented Dec 2, 2018

Hi!
I'm running Centos and there is no $ symbol in prompt, it has # instead.
In other operations, e.g. changing user password, there are no symbols ($, #) at all.

So, may be it should better not to include such symbols in re_strings in expect method?

After I've removed + '$' everything works fine.

I realized something :)
If i login with root, i have # at the end of the prompt, if i login with another user, i have $.
But previous comment, i think, is still actual (we don't need hardcoded $)

@y-me-y
Copy link

y-me-y commented Jan 10, 2019

@rymka1989 - that is actually regex for matching the end of line and before a return if a multiline input. There isn’t a literal match for the string $.

@fgimian
Copy link
Owner

fgimian commented Jan 13, 2019

As @y-me-y explained, this is a regular expression, the $ is the end of line, not a literal. More likely there's something happening on your prompt before the end of line is matched.

@rymkapro
Copy link
Author

@rymka1989 - that is actually regex for matching the end of line and before a return if a multiline input. There isn’t a literal match for the string $.
As @y-me-y explained, this is a regular expression, the $ is the end of line, not a literal. More likely there's something happening on your prompt before the end of line is matched.

I'm very sorry! I understood, that i was wrong.
Thank you very much for your replies!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants