Check lists for Unix Shell Programming

Hi all,

Can anyone provide me any checklists or a list of steps I should follow before executing my scripts.
Could also tell me if there are any other standards to be followed while shell programming like naming conventions for variables etc.

Your help would be much appreciated.

Regards,
Srikanth.

There are some guidelines for scripting here:

http://www.shelldorado.com/

Here are few things I came up with :
Please suggest any changes that you feel necessary :

  1. Header
    Each Shell script file will use this Header template at the top of the file.

#######################< Shell Script>###############
# Owner:
# Application:
#
# Date: DD-MON-YYYY
# File Name:
# Author:
# @(#) Description:
# Parms:
# Called By:
# Output:
#
# Modification History:
#
# Change Date Name Description
# ----------------------------------------------
#
##################################################

  1. Commenting

  2. Lines can be commented with a # (hash)

  3. Make comments distinguishable from the code.

  4. Make sure comments and the code match.

  5. Never comment out a portion of the code without a comment describing why, who and when. If the need for the commented out code has expired, remove the commented out portion.

  6. Comments should be indented to the level of the code they describe.

  7. Modification Log
    Whenever a code is modified make sure that there is a modification log.

A modification log is one which has the details of what has been modified, by whom and when. Include this detail along with the header.

  1. Naming

  2. All the constants and environment variable names should be in Capital letters.

  3. All script variables must be lower case.

  4. All the variable names should be meaningful.

  5. All the function names should be related with the functionality of the code.

  6. Don't name the variable in single character (such as i,j,a), it will be tough to search the single character for code changes.

  7. Don't keep the keywords as variable or function names.