Skip to Content
Exploring Expect
book

Exploring Expect

by Don Libes
December 1994
Intermediate to advanced
606 pages
16h 7m
English
O'Reilly Media, Inc.
Content preview from Exploring Expect

Exercises

  1. Parameterize the send_slow script on page 273.

  2. Write a script which runs a shell such that all of the output written to the standard output and standard error is written humanly.

  3. Write a procedure that takes a 32-bit integer and sends it encoded as four bytes, each byte representing 8 bits worth. It should be analogous to the procedure expect_four_byte_int in Chapter 6 (p. 154).

  4. Run the script on page 271 to find out the size of your system’s canonical input buffer. Modify it if necessary to account for your system’s behavior when the limit is reached. Is this behavior documented anywhere? Is the limit documented anywhere? Try the script on other system types.

  5. Write statements that simulate the sending of the Up, Down, Left, and Right arrow keys on your keyboard.

  6. Solve the previous exercise in a terminal-independent way by using information from the termcap file or terminfo database.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AI Agents in Action

AI Agents in Action

Micheal Lanham
Learning Go

Learning Go

Jon Bodner

Publisher Resources

ISBN: 9781565920903Supplemental ContentErrata Page