123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <h2>DESCRIPTION</h2>
- <p>This program is to be used in shell/perl/python scripts, so the author does not
- need to use the <tt>echo</tt> program. The advantage of <em>g.message</em> is
- that it formats messages just like other GRASS modules do and that its
- functionality is influenced by the <tt>GRASS_VERBOSE</tt> and
- <tt>GRASS_MESSAGE_FORMAT</tt> environment variables.
- <p>The program can be used for standard informative messages as well as warnings
- (<b>-w</b> flag) and fatal errors (<b>-e</b> flag). For debugging
- purposes, the <b>-d</b> flag will cause <em>g.message</em> to print a debugging
- message at the given level.
- <h2>NOTES</h2>
- Messages containing "<tt>=</tt>" must use the full <b>message=</b> syntax so
- the parser doesn't get confused.
- <p>If you want a long message (multi-line) to be dealt with as a single
- paragraph, use a single call to <em>g.message</em> with text split in the
- script using the backslash as the last character. (In shell scripts don't
- close the "quote")
- <p>A blank line may be obtained with: <tt>g.message ""</tt>
- <p>Redundant whitespace will be stripped away.
- <p>It's advisable to single quote the messages that are to be printed literally.
- It prevents a number of characters (most notably, space and the dollar sign
- '<tt>$</tt>') from being treated specifically by the Shell.
- <p>When it is necessary to include, for example, a variable's value as part of
- the message, the double quotes may be used, which do not deprive the
- dollar sign of its special variable-expansion powers.
- <p>While it is known that the interactive Bash instances may treat the
- exclamation mark '<tt>!</tt>' character specifically (making single quoting
- of it necessary), it shouldn't be the case for the non-interactive
- instances of Bash. None the less, to avoid context-based confusion later on
- you are enouraged to single-quote messages that do not require
- <tt>$VARIABLE</tt> expansion.
- <p>
- <h3>VERBOSITY LEVELS</h3>
- Controlled by the "<tt>GRASS_VERBOSE</tt>" environment variable. Typically this
- is set using the <tt>--quiet</tt> or <tt>--verbose</tt> command line options.
- <ul>
- <li>0 - only errors and warnings are printed
- <li>1 - progress messages are printed
- <li>2 - all module messages are printed
- <li>3 - additional verbose messages are printed
- </ul>
- <h3>DEBUG LEVELS</h3>
- Controlled by the "<tt>DEBUG</tt>" GRASS <i>gisenv</i> variable. (set with
- <em><a href="g.gisenv.html">g.gisenv</a></em>)
- <br>
- Recommended levels:
- <ul>
- <li>1 - message is printed once or few times per module
- <li>3 - each row (raster) or line (vector)
- <li>5 - each cell (raster) or point (vector)
- </ul>
- <h2>SEE ALSO</h2>
- <em>
- <a href="variables.html">GRASS variables and environment variables</a>,<br>
- <a href="g.gisenv.html">g.gisenv</a>,
- <a href="g.parser.html">g.parser</a>
- </em>
- <h2>AUTHOR</h2>
- Jachym Cepicky
- <p><i>Last changed: $Date$</i>
|