Shell Programming  «Prev  Next»
Lesson 7 Shell script, other script, or compiled program
Objective Reasons for choosing one programming method

When to use a shell script, other script, or compiled program

List reasons for choosing one programming method over another.

In this module you have read about several methods for completing a programming project. Each method or tool is best used for a particular circumstance. It is up to you to determine which tool to use based on the problem you need to solve. Below are some guidelines to consider when deciding if a shell script or another tool is the right way to solve a problem.
  1. Does the program need to be able to run on a variety of systems, some of which may have a minimal installation or not yet have all programs configured?
    A shell script is the best solution.
  2. Is it important that the program run quickly because it is complex or runs repeatedly? A compiled language such as C is best.
  3. Do you already have parts of the program functionality available in one language? Consider using the same language to finish the project or, if necessary because of the program's design, use another language for some parts of the project after determining how difficult it will be to interface between the two languages used for the project.
  4. Is the task at hand something that could be done from a UNIX command line but needs to be automated? A shell script is probably the appropriate tool.
  5. Do you require a graphical interface for the project? Use a tcl or Python script, or a compiled language with additional graphical tools.
  6. Do you need to complete the project quickly?
    A shell script may be the best solution, or another scripting language if a shell script does not include all the functionality you need.
  7. Does the project involve networking or low-level computation? A compiled language like C is probably best; extensions to Perl and Python can do most of these tasks but are less efficient than a compiled language.

As you can see, the considerations are as numerous as the tools.
Shell scripts are the best tool for the job in some cases; in others, they just are not up to the task.

Different Programming Tools

Click the link below to read about different programming tools and the shell.
Different Programming Tools
In the next lesson, we wrap up this module.