Exercises

  1. Write a program using the Expect library and then rewrite it using the Expect program. Compare the time it took you to write (and debug) both. Compare the size of your source. Compare the size of the resulting executables. What can you conclude from these comparisons? Repeat this exercise on a significantly larger example.

  2. Create a library specifically optimized for ftp. It should contain functions to start and stop ftp, and to send and expect ftp requests. How much simplification can be made over the original expect functions?

  3. Create a terminal-emulator widget for Tk. What are the advantages and disadvantages between such a widget and the approach shown in Chapter 19 (p. 443).

Get Exploring Expect now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.