Design Scripts  «Prev  Next»

Documenting Shell Script - Exercise

Explaining good shell scripting practices

Objective: Explain terms and practices that lead to well-documented shell scripts.

Exercise scoring

This exercise is worth 7 points.

Instructions

Consider the block of comment that appears (or should appear) at the beginning of each shell script. This is internal documentation for a project.
  1. How is self-documenting code different from this? Give an example of something in a script that would be self-documenting versus using something that is not.
  2. How is online usage information different from these comments within a script? How do you view the online usage information for most UNIX commands?
  3. What else can be done to help users know how to use a script?

Submitting your Exercise

Submit your answer into cyberspace in the text box below.