Rechercher une page de manuel

Chercher une autre page de manuel:


Langue: en

Autres versions - même langue

Version: 370331 (fedora - 01/12/10)

Section: 1 (Commandes utilisateur)


g.message - Prints a message, warning, or fatal error the GRASS way.
This module should be used in scripts for messages served to user.




g.message help
g.message [-wediv] message=string [debug=integer] [--verbose] [--quiet]



Print message as GRASS warning

Print message as GRASS fatal error

Print message as GRASS debug message

Print message in all but full quiet mode

Print message only if in verbose mode

Verbose module output

Quiet module output



Text of the message to be printed

Level to use for debug messages
Options: 0-5
Default: 1


This program is to be used in shell/perl/python scripts, so the author does not need to use the echo program. The advantage of g.message is that it formats messages just like other GRASS modules do and that its functionality is influenced by the GRASS_VERBOSE and GRASS_MESSAGE_FORMAT environment variables.

The program can be used for standard informative messages as well as warnings (-w flag) and fatal errors (-e flag). For debugging purposes, the -d flag will cause g.message to print a debugging message at the given level.


Messages containing "=" must use the full message= syntax so the parser doesn't get confused.

Messges containing '!' and '$' must use single 'quotes' to avoid unwanted shell translation.

If you want a long message (mutli-line) to be dealt with as a single paragraph, use a single call to g.message with text split in the script using the backslash as the last character. (In shell scripts don't close the "quote")

A blank line may be obtained with: g.message ""

Redundant whitespace will be stripped away.


Controlled by the "GRASS_VERBOSE" environment variable. Typically this is set using the --quiet or --verbose command line options.
0 - only errors and warnings are printed
1 - progress messages are printed
2 - all module messages are printed
3 - additional verbose messages are printed


Controlled by the "DEBUG" GRASS gisenv variable. (set with g.gisenv)
Recommended levels:
1 - message is printed once or few times per module
3 - each row (raster) or line (vector)
5 - each cell (raster) or point (vector)


GRASS variables and environment variables,
g.gisenv, g.parser


Jachym Cepicky

Last changed: $Date: 2007-05-30 05:42:20 +0200 (Wed, 30 May 2007) $

Full index

© 2003-2008 GRASS Development Team

Mon ombre est une compagne, pas une amie.
-+- Jacques-Henri Lartigue -+-