Exercises
Write a script that retrieves an FAQ. First the script should attempt to get the FAQ locally by using your local news reading software. If the FAQ has expired or is not present for some other reason, the script should anonymously
ftpit fromrtfm.mit.edu. (For instance, the first part of the Tcl FAQ lives in the file/pub/usenet/news.answers/tcl-faq/part1.) If theftpfails because the site is too loaded or is down, the script should go into the background and retry later, or it should send email tomail-server@rtfm.mit.eduin the form:send usenet/news.answers/tcl-faq/part1
Write a script called
netpipethat acts as a network pipe. Shell scripts on two different machines should be able to invokenetpipeto communicate with each other as easily as if they were using named pipes (i.e., fifos) on a single machine.Several of your colleagues are interested in listening to Internet Talk Radio and Internet Town Hall. [58]Unfortunately, each hour of listening pleasure is 30Mb. Rather than tying up your expensive communications link each time the same file is requested, make a
cronentry that downloads the new programs once each day. (For information about the service, send mail to info@radio.com.)The
dialbackscripts in Chapter 1 (p. 4) and Chapter 16 (p. 347) dial back immediately. Useatto delay the start by one minute so that there is time to log out and accept the incoming call on the original modem. Then rewrite the script usingforkanddisconnect. Is there any functional ...
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.
Read now
Unlock full access