[GRASS-SVN] r68066 - grass/branches/releasebranch_7_0/general/g.findfile

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 15 14:08:33 PDT 2016


Author: neteler
Date: 2016-03-15 14:08:33 -0700 (Tue, 15 Mar 2016)
New Revision: 68066

Modified:
   grass/branches/releasebranch_7_0/general/g.findfile/g.findfile.html
Log:
g.findfile manual: shell examples extended

Modified: grass/branches/releasebranch_7_0/general/g.findfile/g.findfile.html
===================================================================
--- grass/branches/releasebranch_7_0/general/g.findfile/g.findfile.html	2016-03-15 21:06:41 UTC (rev 68065)
+++ grass/branches/releasebranch_7_0/general/g.findfile/g.findfile.html	2016-03-15 21:08:33 UTC (rev 68066)
@@ -34,14 +34,18 @@
 eval `g.findfile element=name mapset=name file=name`
 </pre></div>
 
-<p>
-For example (raster map):
+<h2>EXAMPLES</h2>
+
+<h3>SHELL</h3>
+
+<b>Raster map example:</b>
+
 <div class="code"><pre>
 eval `g.findfile element=cell file=elevation`
 </pre></div>
 
-If the specified file does not exist, the variables will be set as
-follows:
+If the specified file (here: raster map) does not exist, the variables
+will be set as follows:
 
 <div class="code"><pre>
 name=
@@ -58,8 +62,19 @@
 fi
 </pre></div>
 
-<h2>PYTHON</h2>
+<p>
+<b>Vector map example (including error message):</b>
 
+<div class="code"><pre>
+eval `g.findfile element=vector file="$G_OPT_V_INPUT"`
+if [ ! "$file" ] ; then
+   g.message -e "Vector map <$G_OPT_V_INPUT> not found"
+   exit 1
+fi
+</pre></div>
+
+<h3>PYTHON</h3>
+
 See <em><a href="http://grass.osgeo.org/grass70/manuals/libpython/">Python
 Scripting Library</a></em> for more info.
 <p>



More information about the grass-commit mailing list