Exercises
Modify the
timed-read
script on page 112 so that it can take an optional default answer which will be returned if the timeout is exceeded.Modify the
rsh
script on page 118 so that it returns the remote status of programs no matter how much output they produce.Modify the
rlogin
script on page 120 so that it copies the X authority file. Modify the script so that it also supportstelnet
.The
dump
program starts by printing an estimate such as:DUMP: estimated 1026958 blocks (501.44MB) on 0.28 tape(s).
Write a script to print out how many tapes the next backup will take.dump
’s knowledge of backup peripherals is often out of date. Assuming you are using a device much bigger thandump
realizes, write a script so thatdump
never stops and asks for a new tape.Enhance the script you wrote for the previous question so that it does a better job of asking for tapes. For example, if your tapes are ten times as big as
dump
thinks, then the script should ask only once for every ten times thatdump
asks.
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.