Exercises
The
ftp-rfcscript does not understand what to do if the user enters multiple RFC numbers on the command line. Modify the script so that it handles this problem.Modify
ftp-rfcso that if given an argument such as "telnet“, the script first retrieves the index, then looks up which RFCs mention the argument in the title, and downloads them. Cache the index and RFCs in a public directory so that they do not have to be repeatedly downloaded.Most
ftpsites use a root directory where onlypubis of interest. The result is that "cd pub" is always the first command everyone executes. Make theaftpscript automaticallycdtopuband print the directories it finds there before turning over control tointeract.Make the
aftpscriptcdtopubonly ifpubexists.Write a script to dial a pager. Use it in the error handling part of a shell script that performs a critical function such as backup or
fsck.The
domainnameprocedure on page 83 is not foolproof. For example, the fileresolv.confmight not exist. Assume the procedure fails on your system and asknslookupfor the current domainname.Write a script that connects to a modem and dials phone numbers from a list until one answers.