- Table of Contents
- Copyright
- About the Lead Authors
- About the Contributing Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- I. Red Hat Linux Installation and User Services
- Chapter 1. Introduction to Red Hat Linux
- Chapter 2. Installation of Your Red Hat System
- Chapter 3. LILO and Other Boot Managers
- Chapter 4. Configuring the X Window System, Version 11
- Chapter 5. Window Managers
- Chapter 6. Connecting to the Internet
- Chapter 7. IRC, ICQ, and Chat Clients
- Chapter 8. Using Multimedia and Graphics Clients
- II. Configuring Services
- Chapter 9. System Startup and Shutdown
- Chapter 10. SMTP and Protocols
- Chapter 11. FTP
- Chapter 12. Apache Server
- Chapter 13. Internet News
- Chapter 14. Domain Name Service and Dynamic Host Configuration Protocol
- Chapter 15. NIS: Network Information Service
- Chapter 16. NFS: Network Filesystem
- Chapter 17. Samba
- III. System Administration and Management
- Chapter 18. Linux Filesystems, Disks, and Other Devices
- Chapter 19. Printing with Linux
- Chapter 20. TCP/IP Network Management
- Chapter 21. Linux System Administration
- Chapter 22. Backup and Restore
- Chapter 23. System Security
- IV. Red Hat Development and Productivity
- Chapter 24. Linux C/C++ Programming Tools
- Chapter 25. Shell Scripting
- Chapter 26. Automating Tasks
- Chapter 27. Configuring and Building Kernels
- Chapter 28. Emulators, Tools, and Window Clients
- V. Appendixes
- A. The Linux Documentation Project
- B. Top Linux Commands and Utilities
- C. The GNU General Public License
- D. Red Hat Linux RPM Package Listings
Tips for Improving Automation Technique
You're in charge of your career in automation. Along with everything else this chapter advises, you'll go furthest if you do the following:
- Improve your automation technique.
- Engineer well.
These tips have specific meaning in the rest of this chapter. Look for ways to apply them in all that follows.
Continuing Education
There are three important ways to improve your skill with automation techniques, which apply equally well whether you're using Perl, cron, Expect, or another mechanism:
- Scan the documentation.
- Read good scripts.
- Practice writing scripts.
Documentation has the reputation of being dry and even unreadable. It's important that you learn how to employ it. All the tools presented here have man pages, which you need to be comfortable using. Read these documents and reread them. Authors of the tools faced many of the challenges you do. Often, reading through the lists of options or keywords, you'll realize that particular capabilities apply exactly to your situation. Study the documentation with this in mind; look for the ideas that you can use. Give particular attention to commands you don't recognize. If some of them—cu or od—are largely superannuated, you'll realize in reading about others—such as tput, ulimit, bc, nice, or wait—that earlier users were confronted with just the situations that confound your own work. Stand on their shoulders and see farther.
It's important to read good programming. Aspiring literary authors find inspiration in Pushkin and Pynchon, not grammar primers; similarly, you'll go furthest when you read the best work of the best programmers. Look in the columns of computer magazines and, most importantly, the archives of software with freely available source code. Good examples of coding occasionally turn up in Usenet discussions. Prize these; read them and learn from the masters.
All the examples in this chapter are written for easy use. They typically do one small task completely; this is one of the best ways to demonstrate a new concept. Although exception handling, and argument validation in particular, is important, covering it is beyond the scope of this chapter.
Crystallize your learning by writing your own scripts. All the documents you read will make more sense after you put the knowledge in place with your own experience.
Good Engineering
The other advice for those pursuing automation is to practice good engineering. This always starts with a clear, well-defined goal. Automation isn't an absolute good; it's only a method for achieving human goals. Part of what you'll learn in working through this chapter is how much, and how little, to automate.
When your goal is set, move as close to it as you can with components that are already written. "Glue" existing programs together with small, understandable scripting modules. Choose meaningful variable names. Define interfaces carefully. Write comments.
Shell Scripts | Next Section

Account Sign In
View your cart