~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to general/g.findfile/description.html

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<h2>DESCRIPTION</h2>
2
 
 
3
 
<em>g.findfile</em> is designed for Bourne shell scripts that need to search
4
 
for mapset <em>elements</em>, including: raster, vector maps, region
5
 
definitions and <em><a href="i.group.html">imagery</a></em> groups.
6
 
<p>
7
 
The list of <em>element</em> names to search for is not fixed; any
8
 
subdirectory of the mapset directory is a valid <em>element</em> name.
9
 
<p>
10
 
However, the user can find the list of standard GRASS <em>element</em> names in
11
 
the file $GISBASE/etc/element_list. This is the file which
12
 
g.remove/g.rename/g.copy use to determine which files need to be
13
 
deleted/renamed/copied for a given entity type.
14
 
 
15
 
<!-- unused
16
 
<h2>OPTIONS</h2>
17
 
 
18
 
<h3>Parameters:</h3>
19
 
 
20
 
<dl>
21
 
 
22
 
<dt><b>element=</b><em>name</em> 
23
 
 
24
 
<dd>The data base element (i.e., directory within a GRASS
25
 
mapset) to be searched.
26
 
 
27
 
<dt><b>mapset=</b><em>name</em> 
28
 
 
29
 
<dd>The mapset in which to search for the specified file
30
 
<em>name</em>.  If not specified, all mapsets in the user's
31
 
GRASS search path are searched.  Otherwise, the specified
32
 
mapset is searched.  As a convenience, if specified as a
33
 
single dot (.) only the current mapset is searched.
34
 
 
35
 
<dt><b>file=</b><em>name</em> 
36
 
 
37
 
<dd>The name of a GRASS data file (of the stated
38
 
<em>element</em> type) for which to search.
39
 
 
40
 
</dl>
41
 
-->
42
 
 
43
 
<h2>OUTPUT</h2>
44
 
 
45
 
<em>g.findfile</em> writes four lines to standard output:
46
 
 
47
 
<div class="code"><pre>
48
 
name='<em>file_name</em>'
49
 
mapset='<em>mapset_name</em>'
50
 
file='<em>unix_filename</em>'
51
 
fullname='<em>grass_fullname</em>'
52
 
</pre></div>
53
 
 
54
 
 
55
 
The output is <em>/bin/sh</em> commands to set the variable
56
 
<em>name</em> to the GRASS data base file name,
57
 
<em>mapset</em> to the mapset in which the file resides,
58
 
and <em>file</em> to the full UNIX path name for the named
59
 
file.  These variables may be set in the <em>/bin/sh</em>
60
 
as follows:
61
 
 
62
 
<div class="code"><pre>
63
 
eval `g.findfile element=name mapset=name file=name`
64
 
</pre></div>
65
 
<p>
66
 
For example (raster map):
67
 
<div class="code"><pre>
68
 
eval `g.findfile element=cell file=mymap`
69
 
</pre></div>
70
 
 
71
 
<h2>NOTES</h2>
72
 
 
73
 
If the specified file does not exist, the variables will be set as follows:
74
 
 
75
 
<div class="code"><pre>
76
 
name=
77
 
mapset=
78
 
fullname=
79
 
file=
80
 
</pre></div>
81
 
 
82
 
 
83
 
The following is a way to test for this case:
84
 
<div class="code">
85
 
<PRE>
86
 
if [ ! "$file" ]
87
 
then
88
 
        exit
89
 
fi
90
 
</PRE>
91
 
</DIV>
92
 
 
93
 
Note that region files are searched as <em>element=windows</em>.
94
 
 
95
 
<h2>SEE ALSO</h2>
96
 
 
97
 
<em><a href="g.ask.html">g.ask</a></em><br>
98
 
<em><a href="g.filename.html">g.filename</a></em><br>
99
 
<em><a href="g.gisenv.html">g.gisenv</a></em><br>
100
 
<em><a href="g.mapsets.html">g.mapsets</a></em><br>
101
 
<em><a href="parser.html">parser</a></em>
102
 
 
103
 
<h2>AUTHOR</h2>
104
 
 
105
 
Michael Shapiro,
106
 
U.S.Army Construction Engineering Research Laboratory
107
 
 
108
 
<p><i>Last changed: $Date: 2011-11-08 12:29:50 +0100 (Tue, 08 Nov 2011) $</i>