Browse Source

g.findfile manual: shell examples extended

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68065 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 9 years ago
parent
commit
f09131ddd7
1 changed files with 20 additions and 5 deletions
  1. 20 5
      general/g.findfile/g.findfile.html

+ 20 - 5
general/g.findfile/g.findfile.html

@@ -34,14 +34,18 @@ as follows:
 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,7 +62,18 @@ then
 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/grass71/manuals/libpython/">Python
 Scripting Library</a></em> for more info.