Exercises

At the end of each chapter are exercises. These exercises are well worth reading—even if you do not do them. The exercises are not of the form “now repeat the examples shown but with slightly changed parameters”. You do not need busy work. You want to apply Expect immediately to your problems.

Instead, the exercises are deliberately meant to be thought provoking. Many of them suggest entirely different ideas than the examples elsewhere in the book. One of the problems with a tool like Expect is that it is so different, it is hard to recognize certain things are possible without actually being told or seeing an example.

Alas, without making the book significantly bigger, there was a limit to the examples I could include. Rather than devoting another two or three pages to explaining each one (or saying “you can do XYZ but I don’t have the space to explain it”), I have left them as exercises. All of them are possible with Expect.

Again, do not approach the exercises as lessons to be done. Rather, think about them and use them as stimulation for discovering other problems you can solve. Together, the examples and exercises in this book are only a tiny fraction of what you can do with Expect.

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.