expect myscript.expto
expect -d myscript.expThe latter invocation provides abundant information about, among other things, the output Expect tries to match. Study of -d reports frequently suffices to solve otherwise-thorny problems."What debugging tools are available to a Tcl programmer" includes several outstanding tips.[exp_internal; Chapters 7, 9, 18, and page 531; ...]
[Explain crucial role of autoexpect (but see mention of interact below). Have beginners start with it.] [Pick appropriate references from FAQ.]
escargo - What I have found useful included log_file and log_user.
[Without doubt, the most useful tool for debugging expect itself is "exp_internal". It's boolean. It tells you what you got, no matter what you "expect"ed.]
[Explain importance of inserting [sleep 1] before password transmission, when all else fails.]
In clt, Don once wrote, "Try changing ... to interact. If you can do the interaction yourself, then it's just a matter of getting the scripting correct."
"Debugging Expect" [1]"Expect's frequently-made mistakes"
[Explain exp_internal.]