.TH g.filename 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBg.filename\fR\fR - Prints GRASS data base file names. .SH KEYWORDS general, map management .SH SYNOPSIS \fBg.filename\fR .br \fBg.filename help\fR .br \fBg.filename element\fR=\fIstring\fR \fBfile\fR=\fIstring\fR [\fBmapset\fR=\fIstring\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Parameters: .IP "\fBelement\fR=\fIstring\fR" 4m .br Name of an element .IP "\fBfile\fR=\fIstring\fR" 4m .br Name of a database file .IP "\fBmapset\fR=\fIstring\fR" 4m .br Name of a mapset (default: current) .PP .SH DESCRIPTION \fIg.filename\fR is designed for Bourne shell scripts that need to know the full file name, including it's path, for mapset elements, like raster, vector and site maps, region definitions and imagery groups. .PP The list of element names to search for is not fixed; any subdirectory of the mapset directory is a valid element name. .PP However, the user can find the list of standard GRASS element names in the file $GISBASE/etc/element_list. This is the file which g.remove/g.rename/g.copy use to determine which files need to be deleted/renamed/copied for a given entity type. .SH OUTPUT \fIg.filename\fR writes one line to standard output: file='\fIfull_file_pathname'\fR .PP The output is a \fI/bin/sh\fR command to set the variable specified by the file \fIname\fR to the full UNIX path name for the data base file. This variable may be set in the \fI/bin/sh\fR as follows: \fC .DS .br eval \(gag.filename element=\fIname\fR mapset=\fIname\fR file=\fIname\fR\(ga .br .DE \fR .PP .SH NOTES This routine generates the filename, but does not care if the file (or mapset or element) exists or not. This feature allows shell scripts to create new data base files as well as use existing ones. .PP If the mapset is the current mapset, \fIg.filename\fR automatically creates the \fIelement\fR specified if it doesn't already exist. This makes it easy to add new files to the data base without having to worry about the existence of the required data base directories. (This program will not create a new mapset, however, if that specified does not currently exist.) .PP The program exits with a 0 if everything is ok; it exits with a non-zero value if there is an error, in which case file=\fI'full_file_pathname'\fR is not output. .SH SEE ALSO \fIg.ask\fR .br \fIg.findfile\fR .br \fIg.gisenv\fR .br \fIparser\fR .SH AUTHOR Michael Shapiro, U.S.Army Construction Engineering Research Laboratory .PP \fILast changed: $Date: 2011-11-08 12:29:50 +0100 (Tue, 08 Nov 2011) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team