1g.findfile(1)                 Grass User's Manual                g.findfile(1)
2
3
4

NAME

6       g.findfile  - Searches for GRASS data base files and sets variables for
7       the shell.
8

KEYWORDS

10       general
11

SYNOPSIS

13       g.findfile
14       g.findfile help
15       g.findfile element=string   [mapset=string]   file=string   [--verbose]
16       [--quiet]
17
18   Parameters:
19       element=string
20           Name of an element
21
22       mapset=string
23           Name of a mapset
24           Default:
25
26       file=string
27           Name of an existing map
28

DESCRIPTION

30       g.findfile is designed for Bourne shell scripts that need to search for
31       mapset elements, including: raster, vector maps, region definitions and
32       imagery groups.
33
34       The  list of element names to search for is not fixed; any subdirectory
35       of the mapset directory is a valid element name.
36
37       However, the user can find the list of standard GRASS element names  in
38       the   file   $GISBASE/etc/element_list.   This   is   the   file  which
39       g.remove/g.rename/g.copy use  to  determine  which  files  need  to  be
40       deleted/renamed/copied for a given entity type.
41

OUTPUT

43       g.findfile writes four lines to standard output:
44       name='file_name'
45       mapset='mapset_name'
46       file='unix_filename'
47       fullname='grass_fullname'
48         The  output is /bin/sh commands to set the variable name to the GRASS
49       data base file name, mapset to the mapset in which  the  file  resides,
50       and  file  to  the full UNIX path name for the named file.  These vari‐
51       ables may be set in the /bin/sh as follows:
52       eval `g.findfile element=name mapset=name file=name`
53
54
55       For example (raster map):
56       eval `g.findfile element=cell file=mymap`
57
58

NOTES

60       If the specified file does not exist, the variables will be set as fol‐
61       lows:
62       name=
63       mapset=
64       fullname=
65       file=
66        The following is a way to test for this case:
67       if [ ! "$file" ]
68       then
69            exit
70       fi
71        Note that region files are searched as element=windows.
72

SEE ALSO

74       g.ask
75       g.filename
76       g.gisenv
77       g.mapsets
78       parser
79

AUTHOR

81       Michael Shapiro, U.S.Army Construction Engineering Research Laboratory
82
83       Last changed: $Date: 2007-01-18 17:09:29 +0100 (Thu, 18 Jan 2007) $
84
85       Full index
86
87       © 2003-2008 GRASS Development Team
88
89
90
91GRASS 6.3.0                                                      g.findfile(1)
Impressum