Exercises

  1. Using .netrc or << redirection in a shell script, have ftp retrieve a file. Make the script retry if the remote site is too busy but not if the file cannot be found.

  2. Count the number of times that people have rewritten ftp to make it more flexible. Use Archie if you need help.

  3. Count the number of programs you use that each have a different language for writing scripts or .rc files.

  4. Find Expect’s example directory online and try out some of the examples. Rewrite one in your favorite language.

  5. Think about each keystroke that you press today. How much is the same from one session to the next? How much can be automated?

  6. UNIX existed for over 20 years—without Expect. What did people do before? Which of those solutions still make sense today?

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.