
NAME
g.findfile  - Searches for GRASS data base files and sets variables for the shell.
KEYWORDS
general
SYNOPSIS
g.findfile
g.findfile help
g.findfile element=string  [mapset=string]  file=string 
Parameters:
- element=string
- Name of an element
- mapset=string
- Name of a mapset
- Default: 
- file=string
- Name of an existing map
DESCRIPTION
g.findfile is designed for Bourne shell scripts that need to search
for mapset elements, including: raster, vector maps, region
definitions and imagery groups.
The list of element names to search for is not fixed; any
subdirectory of the mapset directory is a valid element name.
However, the user can find the list of standard GRASS element names in
the file $GISBASE/etc/element_list. This is the file which
g.remove/g.rename/g.copy use to determine which files need to be
deleted/renamed/copied for a given entity type.
OUTPUT
g.findfile writes four lines to standard output:
name='file_name'
mapset='mapset_name'
file='unix_filename'
fullname='grass_fullname'
eval `g.findfile element=name mapset=name file=name`
For example (raster map):
eval `g.findfile element=cell file=mymap`
NOTES
If the specified file does not exist, the variables will be set as follows:
name=
mapset=
fullname=
file=
if [ ! "$file" ]
then
	exit
fi
 
Note that region files are searched as element=windows.
SEE ALSO
g.ask
g.filename
g.gisenv
g.mapsets
parser
AUTHOR
Michael Shapiro,
U.S.Army Construction Engineering Research Laboratory
Last changed: $Date: 2007/01/18 17:29:43 $
Main index - general index - Full index