DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Programming with the UNIX system shell

Comments

When you place comments in a shell program, the shell ignores all text on a line following a word that begins with a ``#'' (pound) sign. If the ``#'' sign appears at the beginning of a line, the comment uses the entire line; if it appears after a command, the command is executed but the remainder of the line is ignored. The end of a line always ends a comment. The general format for a comment line is

   #comment
For example, a program that contains the following lines will ignore them when it is executed:
   # This program sends a generic birthday greeting.
   # This program needs a login as
   # the positional parameter.
Comments are useful for documenting the function of a program and should be included in any program you write.
Next topic: Here documents
Previous topic: Shell programming constructs

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004