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. Using the random procedure (page 518), write a Tk script that draws a plot of a large number of random values. Use time (modulo the plot width) as the second dimension in the plot. Look for patterns in the plot.

  2. Many Tcl extensions come with libraries that are used by the extension itself but are not documented for users. Look through all the Tcl libraries for useful but undocumented utilities.

  3. Check the version of Expect that you are running. See if you can find a later one. Do your scripts still work?

  4. Use the time command and compare "string match" against regexp doing similar things. Is this reflected in the -gl and -re flags in the expect command?

  5. Time the UNIX sleep command and compare it to the built-in sleep command. At what point is the difference moot? How does this change if you are on a much slower or faster machine?

  6. What timestamp would exactly duplicate the default output of the UNIX date command? Time date and timestamp.

  7. Expect does not have a procedure that does the opposite of timestamp—converts a string to a date represented as an integer. Why is that? Write one anyway.

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