1g.filename(1)               GRASS GIS User's Manual              g.filename(1)
2
3
4

NAME

6       g.filename  - Prints GRASS data base file names.
7

KEYWORDS

9       general, map management, scripts
10

SYNOPSIS

12       g.filename
13       g.filename --help
14       g.filename   element=string   file=string   [mapset=string]    [--help]
15       [--verbose]  [--quiet]  [--ui]
16
17   Flags:
18       --help
19           Print usage summary
20
21       --verbose
22           Verbose module output
23
24       --quiet
25           Quiet module output
26
27       --ui
28           Force launching GUI dialog
29
30   Parameters:
31       element=string [required]
32           Name of an element
33
34       file=string [required]
35           Name of a database file
36
37       mapset=string
38           Name of a mapset (default: current)
39

DESCRIPTION

41       g.filename is designed for Bourne shell scripts that need to  know  the
42       full  file name, including it’s path, for mapset elements, like raster,
43       vector and site maps, region definitions and imagery groups.
44
45       The list of element names to search for is not fixed; any  subdirectory
46       of the mapset directory is a valid element name.
47
48       However, the user can find the list of standard GRASS GIS element names
49       in  the  file  $GISBASE/etc/element_list.  This  is  the   file   which
50       g.remove/g.rename/g.copy  use  to  determine  which  files  need  to be
51       deleted/renamed/copied for a given entity type.
52

OUTPUT

54       g.filename writes one line to standard output:
55       file=’full_file_pathname’ The output is a /bin/sh command  to  set  the
56       variable  specified by the file name to the full UNIX path name for the
57       data base file.  This variable may be set in the /bin/sh as follows:
58       eval `g.filename element=name mapset=name file=name`
59

NOTES

61       This module generates the filename, but does not care if the  file  (or
62       mapset  or element) exists or not. This feature allows shell scripts to
63       create new data base files as well as use existing ones.
64
65       If the mapset is the current mapset, g.filename  automatically  creates
66       the  element specified if it doesn’t already exist.  This makes it easy
67       to add new files to the data base without having  to  worry  about  the
68       existence  of  the  required data base directories.  (This program will
69       not create a new mapset, however, if that specified does not  currently
70       exist.)
71
72       The  program  exits  with  a  0  if  everything is ok;  it exits with a
73       non-zero   value   if   there   is   an   error,    in    which    case
74       file=’full_file_pathname’ is not output.
75

SEE ALSO

77        g.findfile, g.gisenv
78

AUTHOR

80       Michael Shapiro, U.S.Army Construction Engineering Research Laboratory
81

SOURCE CODE

83       Available at: g.filename source code (history)
84
85       Main  index | General index | Topics index | Keywords index | Graphical
86       index | Full index
87
88       © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
89
90
91
92GRASS 7.8.5                                                      g.filename(1)
Impressum