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

[v2.3.7] interact -re PATTERN: detach upon matching a specified pattern #19

Closed
clarkwang opened this issue Jul 9, 2021 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@clarkwang
Copy link
Owner

clarkwang commented Jul 9, 2021

  • I used to think this is not quite useful. Changed my idea recently when writing a script which needs to input password in an interactive way for security's sake.
  • The whole logic can be done in the client side. Don't complicate the server side.

A bit more background:
In a corporate env it's not appropriate to ask users to pass their corporate account's passwords in command line. After spawning a program, when it prompts for the password, enter interactive mode and ask users to input their password manually, then automatically exit interactive mode when matching a specified pattern, then continue running the rest of the script.

@clarkwang
Copy link
Owner Author

clarkwang commented Jul 11, 2021

Will only support -re PATTERN:

sexpect interact [-nocase | -icase | -i] [-cstring | -cstr | -c] -re PATTERN

@clarkwang clarkwang added the enhancement New feature or request label Jul 11, 2021
@clarkwang clarkwang changed the title [RFE] interact: detach upon matching a specified pattern interact -re PATTERN: detach upon matching a specified pattern Jul 11, 2021
@clarkwang
Copy link
Owner Author

There are quite some issues if the interact -re PATTERN logic is implemented in client side.

  1. sexpect sp bash --norc
  2. sexpect s -cr 'echo {a..z} | tr -d " " '
  3. sexpect i -re abc
  4. sexpect ex -re def <== This is supposed to succeed.

Sounds like the logic has to be moved to the server side.

@clarkwang clarkwang changed the title interact -re PATTERN: detach upon matching a specified pattern [v2.3.7] interact -re PATTERN: detach upon matching a specified pattern Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant