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

11.7 Exercises

See Appendix A, Exercise Answers for answers.

  1. Write a program to open the /etc/passwd file by name and print out the username, user ID (number), and real name in formatted columns. Use format and write .

  2. Add a top-of-page format to the previous program. (If your password 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 the page.)

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