Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

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:

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:

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.

Share ThisShare This

Informit Network