DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Automating frequent tasks

Tuning script performance

The primary reason for choosing a shell procedure to perform a specific function is to achieve a desired result at a minimum cost in terms of user time. This entails reducing both the effort that the user has to put into achieving their goal, and the time taken.

Good shell programming technique relies on an understanding of the desired goal and the ability to write clear, easily debugged scripts, but you can also add efficiency through awareness of a few simple rules of thumb.

An effective redesign of an existing procedure improves its efficiency by reducing its size, and often increases its comprehensibility. In any case, you should not worry about optimizing shell procedures unless they are intolerably slow or are known to consume an inordinate amount of a system's resources. Your time, as the programmer, is almost certainly more expensive than the computer's.


Next topic: How programs perform
Previous topic: Assigning variables default values

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003