home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


11.8 Exercises

See Appendix A, Exercise Answers for answers.

  1. Write a program that reads a file containing a list of lines composed of a user name, a company name, and an email address separated by colons. A sample line might look like this:

         John Doe:Foo Technologies:jdoe@footech.com

    Print out each field in formatted columns. Use format and write .

  2. Add a top-of-page format to the previous program. (If your file is relatively short, you might need to set the pagelength to something like 10 lines so that you can get multiple instances of the top-of-page.)

  3. Add a sequentially increasing page number to the top-of-page, so that you get page 1 , page 2 , and so on, in the output.