3
<em>g.filename</em> is designed for Bourne shell scripts that need to know
4
the full file name, including it's path, for mapset elements, like raster,
5
vector and site maps, region definitions and imagery groups.
7
The list of element names to search for is not fixed; any subdirectory of the
8
mapset directory is a valid element name.
10
However, the user can find the list of standard GRASS element names in
11
the file $GISBASE/etc/element_list. This is the file which
12
g.remove/g.rename/g.copy use to determine which files need to be
13
deleted/renamed/copied for a given entity type.
21
<dt><b>element=</b><em>name</em>
23
<dd>The name of a GRASS data base element (i.e., directory
24
within the GRASS mapset location).
26
<dt><b>mapset=</b><em>name</em>
28
<dd>The name of a GRASS data base mapset. As a
29
convenience, a single dot (.) can be used to designate the
32
<dt><b>file=</b><em>name</em>
34
<dd>The name of a GRASS data base file.
40
writes one line to standard output:
44
file='<em>full_file_pathname'</em>
47
The output is a <em>/bin/sh</em> command to set the
48
variable specified by the file <em>name</em> to the full
49
UNIX path name for the data base file. This variable may
50
be set in the <em>/bin/sh</em> as follows:
54
<div class="code"><pre>
55
eval `g.filename element=<em>name</em> mapset=<em>name</em> file=<em>name</em>`
62
This routine generates the filename, but does not care if the file (or mapset
63
or element) exists or not. This feature allows shell scripts to create new data
64
base files as well as use existing ones.
68
If the mapset is the current mapset, <em>g.filename</em>
69
automatically creates the <em>element</em> specified if it
70
doesn't already exist. This makes it easy to add new files
71
to the data base without having to worry about the
72
existence of the required data base directories. (This
73
program will not create a new mapset, however, if that
74
specified does not currently exist.)
77
The program exits with a 0 if everything is ok; it exits
78
with a non-zero value if there is an error, in which case
79
file=<em>'full_file_pathname'</em> is not output.
83
<em><a href="g.ask.html">g.ask</a></em><br>
84
<em><a href="g.findfile.html">g.findfile</a></em><br>
85
<em><a href="g.gisenv.html">g.gisenv</a></em><br>
86
<em><a href="parser.html">parser</a></em>
91
U.S.Army Construction Engineering Research Laboratory
93
<p><i>Last changed: $Date: 2011-11-08 12:29:50 +0100 (Tue, 08 Nov 2011) $</i>