## NAME

grass5 - The GRASS startup program

## SYNOPSIS

grass5 [-] [-h | -help | --help] [-text | -tcltk] [-v | --version] [[[<GISDBASE>/]<LOCATION_NAME>/] <MAPSET>]

## DESCRIPTION

This program is used to start GRASS. It will parse the command line arguments and then initialize GRASS for the user. Since GRASS programs require a specific environment, this program must be called before any other GRASS program can run. The command line arguments are optional and provide the user with a method to indicate the desired user interface, as well as the desired mapset to work on.

## FEATURES

The GRASS program will save both the desired user interface and mapset. Thus, the next time the user runs GRASS, typing grass5 (without any options) will start grass with the previous settings for the user interface and mapset.

If you specify a graphical user interface (eg Tcl/Tk) the grass5 program will try to verify that the system you specified exists and that you can access it successfully. If any of these checks fail, then grass5 will automatically switch back to the text user interface mode.

## OPTIONS

All command line options are optional.

### Flags:

-
  Tries to start GRASS using location environment variables (see below)
-h -help --help
  Prints a brief usage message
-text
  Indicates that the text based user interface should be used
-tcltk
  Indicates that the Tcl/Tk based graphical user interface should be used
-v --version
  Prints the version for GRASS

### Parameters:

GISDBASE
  Initial database directory which should be a fully qualified path (eg /usr/local/grassData)
LOCATION_NAME
  Initial location directory which is a subdirectory of GISDBASE
MAPSET
  Initial mapset directory which is a subdirectory of LOCATION_NAME
Note
  You must specify one of the following
  MAPSET
  LOCATION_NAME/MAPSET
  GISDBASE/LOCATION_NAME/MAPSET

## ENVIRONMENT VARIABLES

### User Interface Environment Variable

The grass5 program will check for the existence of an environment variable called GRASS_GUI which indicates the type of user interface for GRASS to use. If this variable is not set when grass5 is run, then it will be created and then saved in the $HOME/.grassrc5 file for the next time GRASS is run.

There is an order of precedence in the way grass5 determines the user interface to use. The following is the hierarchy from highest precedence to lowest.

The user may add own environment variable settings to $HOME/.grassrc5 file which are used during next startup of GRASS (list of implemented environment variables).

Interface precedence
  Command line argument
  Environment variable GRASS_GUI
  Value set in $HOME/.grassrc5
  Default value - currently tcltk

### Tcl/Tk Environment Variables

If you choose to use the Tcl/Tk graphical user interface, then the following environment variables can be used to override your system default tclsh and wish commands. See the section immediately following the variable descriptions for an example.

GRASS_TCLSH
  Command to use to override tclsh
GRASS_WISH
  Command to use to override wish

#### Example Use of GRASS Tcl/Tk Environment Variables

Suppose your system has Tcl/Tk 8.0 installed and you install your personal version of Tcl/Tk 8.3 binaries installed under $HOME/bin. You can use the above variables to have GRASS use the Tcl/Tk 8.3 binaries instead.

GRASS_TCLSH = $HOME/bin/tclsh8.3
GRASS_WISH = $HOME/bin/wish8.3

### Addon path to extra local GRASS modules

This environment variables allows to extend the GRASS paths to locally developed/installed modules which are not distributes through the standard release of GRASS.

GRASS_ADDON_PATH=/usr/mytools
GRASS_ADDON_PATH=/usr/mytools:/usr/local/othertools

In this example above path(s) would be added to the standard GRASS path environment.

### Location Environment Variables

The Synopsis and Options sections above describe options that can be used to set the location and mapset that GRASS will use. These values can also be set with environment variables. However, specifying the location and mapset variables on the command line will override these environment variables. The available variables are as follows:

LOCATION
  A fully qualified path to a mapset (eg /usr/local/grassData/spearfish/PERMANENT). This environment variable overrides the GISDBASE, LOCATION_NAME, and MAPSET variables.
GISDBASE
  Initial database directory which should be a fully qualified path (eg /usr/local/grassData)
LOCATION_NAME
  Initial location directory which is a subdirectory of GISDBASE
MAPSET
  Initial mapset directory which is a subdirectory of LOCATION_NAME

There are a variety of ways in which these variables can be used to specify the mapset to use. The following are some possible examples.

Example 1
  The environment variables are defined as follows:
  LOCATION = /usr/local/grassData/spearfish/PERMANENT
  GISDBASE = /usr/local/grassData
  LOCATION_NAME = spearfish
  MAPSET = PERMANENT
  Start GRASS with the following command:
  grass5 -
  GRASS will start with the mapset defined by LOCATION since the LOCATION variable overrides the other variables.
Example 2
  The environment variables are defined as follows:
  GISDBASE = /usr/local/grassData
  LOCATION_NAME = spearfish
  MAPSET = PERMANENT
  Start GRASS with the following command:
  grass5 -
  GRASS will start with the mapset defined by GISDBASE/LOCATION_NAME/MAPSET.
Example 3
  The environment variables are defined as follows:
  LOCATION = /usr/local/grassData/spearfish/PERMANENT
  GISDBASE = /usr/local/grassData
  LOCATION_NAME = spearfish
  MAPSET = PERMANENT
  Start GRASS with the following command:
  grass5 /usr/home/grass/data/thailand/forests
  GRASS will start with the mapset /home/grass/data/thailand/forests which overrides the environment variables.
Example 4
  The environment variables are defined as follows:
  LOCATION = /usr/local/grassData/spearfish/PERMANENT
  GISDBASE = /usr/local/grassData
  LOCATION_NAME = spearfish
  MAPSET = PERMANENT
  Start GRASS with the following command:
  grass5 swamps
  GRASS will start with the mapset defined by GISDBASE/LOCATION_NAME/swamps since the command line argument for the mapset overrides the environment variable MAPSET.
Example 5
  The environment variables are defined as follows:
  LOCATION = /usr/local/grassData/spearfish/PERMANENT
  GISDBASE = /usr/local/grassData
  LOCATION_NAME = spearfish
  MAPSET = PERMANENT
  Start GRASS with the following command:
  grass5 thailand/forests
  GRASS will start with the mapset defined by GISDBASE/thailand/forests since the command line arguments for the location and mapset overrides the environment variables LOCATION_NAME and MAPSET.

### Note

Note that you will need to set these variables using the appropriate method required for the UNIX shell that you use.

## EXAMPLES

The following are some examples of how you could start GRASS

grass5
  Start GRASS using the default user interface. The user will be prompted to choose the appropriate location and mapset.
grass5 -tcltk
  Start GRASS using the Tcl/Tk based user interface. The user will be prompted to choose the appropriate location and mapset.
grass5 -text
  Start GRASS using the text based user interface. The user will be prompted to choose the appropriate location and mapset.
grass5 -tcltk -
  Start GRASS using the Tcl/Tk based user interface and try to obtain the location and mapset from environment variables.
Other examples
  See the Location Environment Variables section for further examples.

## BUGS AND CAVEAT

If you start GRASS using the Tcl/Tk interface you must have a wish command in your $PATH variable. That is, the command must be named wish and not something like wish8.3. By default, a Tcl/Tk installation does not create a wish command. Thus, the system administrator must create an appropriate link to the actual wish program.

For example, suppose Tcl/Tk 8.3 programs are installed in /usr/local/bin. Then the system administrator should go to the /usr/local/bin directory and run the commands ln -s wish8.3 wish and ln -s tclsh8.3 tclsh to properly install Tcl/Tk for use with GRASS.

Furthermore, if you have more than one version of Tcl/Tk installed, make sure that the version you want to use with GRASS is the first version found in your $PATH variable. GRASS searches your $PATH variable until it finds the first version of wish.

## FILES

$UNIX_BIN/grass5 - GRASS startup program
$GISBASE/etc/Init.sh - GRASS initialization script called by grass5
$GISBASE/tcltkgrass/script/gis_set.tcl - Tcl/Tk script to set the location and mapset to use. Called by Init.sh

## SEE ALSO

List of implemented GRASS environment variables.

## AUTHOR

Justin Hickey (jhickey@hpcc.nectec.or.th)

Last changed: $Date: 2002/03/01 00:08:31 $