1g.filename(1) Grass User's Manual g.filename(1)
2
3
4
6 g.filename - Prints GRASS data base file names.
7
9 general
10
12 g.filename
13 g.filename help
14 g.filename element=string file=string [mapset=string]
15
16 Parameters:
17 element=string
18 Name of an element
19
20 file=string
21 Name of a database file
22
23 mapset=string
24 Name of a mapset (default: current)
25
27 g.filename is designed for Bourne shell scripts that need to know the
28 full file name, including it's path, for mapset elements, like raster,
29 vector and site maps, region definitions and imagery groups.
30
31 The list of element names to search for is not fixed; any subdirectory
32 of the mapset directory is a valid element name.
33
34 However, the user can find the list of standard GRASS element names in
35 the file $GISBASE/etc/element_list. This is the file which
36 g.remove/g.rename/g.copy use to determine which files need to be
37 deleted/renamed/copied for a given entity type.
38
40 g.filename writes one line to standard output: file='full_file_path‐
41 name'
42
43 The output is a /bin/sh command to set the variable specified by the
44 file name to the full UNIX path name for the data base file. This
45 variable may be set in the /bin/sh as follows:
46 eval `g.filename element=name mapset=name file=name`
47
48
50 This routine generates the filename, but does not care if the file (or
51 mapset or element) exists or not. This feature allows shell scripts to
52 create new data base files as well as use existing ones.
53
54 If the mapset is the current mapset, g.filename automatically creates
55 the element specified if it doesn't already exist. This makes it easy
56 to add new files to the data base without having to worry about the
57 existence of the required data base directories. (This program will
58 not create a new mapset, however, if that specified does not currently
59 exist.)
60
61 The program exits with a 0 if everything is ok; it exits with a non-
62 zero value if there is an error, in which case file='full_file_path‐
63 name' is not output.
64
66 g.ask
67 g.findfile
68 g.gisenv
69 parser
70
72 Michael Shapiro, U.S.Army Construction Engineering Research Laboratory
73
74 Last changed: $Date: 2006/10/25 16:13:51 $
75
76 Full index
77
78
79
80GRASS 6.2.2 g.filename(1)