1g.filename(1)                 Grass 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
82       Last changed: $Date: 2015-02-14 22:07:18 +0100 (Sat, 14 Feb 2015) $
83

SOURCE CODE

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