<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>GRASS GIS: g.message</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="grassdocs.css" type="text/css"> </head> <body bgcolor="white"> <img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade> <h2>NAME</h2> <em><b>g.message</b></em> - Prints a message, warning, or fatal error the GRASS way.<BR> This module should be used in scripts for messages served to user. <h2>KEYWORDS</h2> general <h2>SYNOPSIS</h2> <b>g.message</b><br> <b>g.message help</b><br> <b>g.message</b> [-<b>wediv</b>] <b>message</b>=<em>string</em> [<b>debug</b>=<em>integer</em>] [--<b>verbose</b>] [--<b>quiet</b>] <h3>Flags:</h3> <DL> <DT><b>-w</b></DT> <DD>Print message as GRASS warning</DD> <DT><b>-e</b></DT> <DD>Print message as GRASS fatal error</DD> <DT><b>-d</b></DT> <DD>Print message as GRASS debug message</DD> <DT><b>-i</b></DT> <DD>Print message in all but full quiet mode</DD> <DT><b>-v</b></DT> <DD>Print message only if in verbose mode</DD> <DT><b>--verbose</b></DT> <DD>Verbose module output</DD> <DT><b>--quiet</b></DT> <DD>Quiet module output</DD> </DL> <h3>Parameters:</h3> <DL> <DT><b>message</b>=<em>string</em></DT> <DD>Text of the message to be printed</DD> <DT><b>debug</b>=<em>integer</em></DT> <DD>Level to use for debug messages</DD> <DD>Options: <em>0-5</em></DD> <DD>Default: <em>1</em></DD> </DL> <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> <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. </p> <h2>NOTES</h2> Messages containing "<tt>=</tt>" must use the full <b>message=</b> syntax so the parser doesn't get confused. <P> Messges containing '<tt>!</tt>' and '<tt>$</tt>' must use single 'quotes' to avoid unwanted shell translation. <P> If you want a long message (mutli-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> <h4>VERBOSITY LEVELS</h4> 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> <h4>DEBUG LEVELS</h4> 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: 2007-05-30 05:42:20 +0200 (Wed, 30 May 2007) $</i> <HR> <P><a href="index.html">Main index</a> - <a href="general.html">general index</a> - <a href="full_index.html">Full index</a></P> <P>© 2003-2008 <a href="http://grass.osgeo.org">GRASS Development Team</a></p> </body> </html>