clarkwang / sexpect

Expect for Shells
GNU General Public License v3.0
120 stars 16 forks source link

Implement "interact_out" like in Expect? #21

Closed clarkwang closed 3 years ago

clarkwang commented 3 years ago

Issue #19 added interact -re PATTERN but how to get interact_out?

For now, the interact -re PATTERN logic is implemented in client side. Moving it to server side will complicate the server side code quite a lot. And interact must exit with different codes to distinguish between

  1. EOF
  2. ctrl-]
  3. -re PATTERN
  4. Other errors.
clarkwang commented 3 years ago

Is it ok to be a bit ugly?

$ sexpect interact -re PATTERN -outfile FILE
clarkwang commented 3 years ago

19 is moving interact -re PATTERN logic to server side. Then we can reuse expect_out.