[GRASS-SVN] r50242 - grass/branches/develbranch_6/scripts/v.report

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 17 14:33:13 EST 2012


Author: hamish
Date: 2012-01-17 11:33:13 -0800 (Tue, 17 Jan 2012)
New Revision: 50242

Modified:
   grass/branches/develbranch_6/scripts/v.report/v.report
Log:
quote some variables (probably not really needed)

Modified: grass/branches/develbranch_6/scripts/v.report/v.report
===================================================================
--- grass/branches/develbranch_6/scripts/v.report/v.report	2012-01-17 19:26:55 UTC (rev 50241)
+++ grass/branches/develbranch_6/scripts/v.report/v.report	2012-01-17 19:33:13 UTC (rev 50242)
@@ -99,14 +99,14 @@
 LAYER="$GIS_OPT_LAYER"
 
 # does the input vector map exist?
-eval `g.findfile element=vector file=$GIS_OPT_MAP`
+eval `g.findfile element=vector file="$GIS_OPT_MAP"`
 if [ ! "$file" ] ; then
    g.message -e "Vector map '$MAP' not found in mapset search path."
    exit 1
 fi
 
 #test if the input vector has a table attached in the given layer
-v.info -c map=$MAP layer=$LAYER >/dev/null 2>&1
+v.info -c map="$MAP" layer="$LAYER" >/dev/null 2>&1
 if [ $? -eq 0 ] ; then
  TABLEEXISTS=1
 else
@@ -114,7 +114,7 @@
 fi
 
 #fetch column names
-if [ $TABLEEXISTS -eq 1 ] ; then
+if [ "$TABLEEXISTS" -eq 1 ] ; then
  COLNAMES="`v.info -c map=$MAP layer=$LAYER | grep -v '^Displaying column type' | cut -d '|' -f2 | tr '\n' '|'`" >/dev/null 2>&1
 else
  COLNAMES="cat|"
@@ -140,7 +140,7 @@
 
 ## NOTE: we suppress -1 cat and 0 cat
 
-if [ $TABLEEXISTS -eq 1 ] ; then
+if [ "$TABLEEXISTS" -eq 1 ] ; then
    v.db.select -c map="$MAP" layer="$LAYER" | sort -n -t'|' -k 1 | grep -v '^0' > "$TMP1"
    if [ `wc -l "$TMP1" | awk '{print $1}'` -eq 0 ] ; then
       KEY=`v.db.connect -gl map="$GIS_OPT_MAP" fs="|" layer="$LAYER" | cut -f3 -d'|'`



More information about the grass-commit mailing list