On 7/14/22 3:22 PM, Steve Wilson wrote:
Have you looked at dev-tcltk/expect?

Expect has it's place.

Just be EXTREMELY careful when using it for anything security related.

Always check for what is expected before sending data. Don't assume that something comes next and blindly send it (possibly after a pause).

Things break in a really weird and unexpected way.  (No pun intended.)

Also, do as much logic outside of expect as possible. E.g. don't try to add a user and then respond to a failure. Instead check to see if the user exists /before/ trying to add it.

Plan on things failing and try to control the likely ways that it can fail.

Paying yourself forward with time and effort developing (expect) scripts will mean that you reap the rewards for years to come.



--
Grant. . . .
unix || die

Reply via email to