PreviousNext

Documenting Scripts with Comments

When you are writing scripts, you might want to include some comment lines to remind yourself and others what the script is doing. Use the hash mark (#) to insert comments. The dcecp program suppresses interpretation between a hashmark and the next newline. You must place the hash mark in a position where dcecp expects the first character of a command. Both of the following examples are valid:

set a 5
# sets a to 5

set a 5 ;# sets a to 5

The following example is not valid because the hash mark is not positioned where dcecp expects the first character of a command.

set a 5 # sets a to 5

A common use of comments is to document procedures in scripts as in the following example script fragment.

.
.
.
#
# _dcp_cleanup_user_create - This function undoes changes after a
# failure in one of the user create functions as though the operation
# never occurred.
#

proc _dcp_cleanup_user_create {account_name args} {
.
.
.