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