Exercises
Experiment with
telnet
by writing a script to try all of the different port numbers. Record what comes back.In the
aftp
script on page 141, I hardcoded my own name and address. Modify the script so that it uses the name and address of whomever runs it.Write the
putfile
andputdirectory
procedures that are used by the excerpt fromrftp
on page 131.Write a procedure to count the number of lines in a string. Do it without looping. Modify the procedure so that it counts the number of digits in a string. Where might this be useful?
Enhance the
maxtime
script from Chapter 4 (p. 98) so that it can exit after there is no output for the given amount of time. Provide a command-line option to select this behavior.
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.