Contents | < Browse | Browse >
Comments in `awk' Programs
==========================
A "comment" is some text that is included in a program for the sake
of human readers, and that is not really part of the program. Comments
can explain what the program does, and how it works. Nearly all
programming languages have provisions for comments, because programs are
typically hard to understand without their extra help.
In the `awk' language, a comment starts with the sharp sign
character, `#', and continues to the end of the line. The `awk'
language ignores the rest of a line following a sharp sign. For
example, we could have put the following into `th-prog':
# This program finds records containing the pattern `th'. This is how
# you continue comments on additional lines.
/th/
You can put comment lines into keyboard-composed throw-away `awk'
programs also, but this usually isn't very useful; the purpose of a
comment is to help you or another person understand the program at a
later time.