1 |
On 7/14/22 3:22 PM, Steve Wilson wrote: |
2 |
> Have you looked at dev-tcltk/expect? |
3 |
|
4 |
Expect has it's place. |
5 |
|
6 |
Just be EXTREMELY careful when using it for anything security related. |
7 |
|
8 |
Always check for what is expected before sending data. Don't assume |
9 |
that something comes next and blindly send it (possibly after a pause). |
10 |
|
11 |
Things break in a really weird and unexpected way. (No pun intended.) |
12 |
|
13 |
Also, do as much logic outside of expect as possible. E.g. don't try to |
14 |
add a user and then respond to a failure. Instead check to see if the |
15 |
user exists /before/ trying to add it. |
16 |
|
17 |
Plan on things failing and try to control the likely ways that it can fail. |
18 |
|
19 |
Paying yourself forward with time and effort developing (expect) scripts |
20 |
will mean that you reap the rewards for years to come. |
21 |
|
22 |
|
23 |
|
24 |
-- |
25 |
Grant. . . . |
26 |
unix || die |