[GRASS-SVN] r40274 - grass/branches/develbranch_6/scripts/v.db.addcol

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 5 23:19:05 EST 2010


Author: hamish
Date: 2010-01-05 23:19:05 -0500 (Tue, 05 Jan 2010)
New Revision: 40274

Modified:
   grass/branches/develbranch_6/scripts/v.db.addcol/v.db.addcol
Log:
quote some variables (probably not important)

Modified: grass/branches/develbranch_6/scripts/v.db.addcol/v.db.addcol
===================================================================
--- grass/branches/develbranch_6/scripts/v.db.addcol/v.db.addcol	2010-01-06 02:06:14 UTC (rev 40273)
+++ grass/branches/develbranch_6/scripts/v.db.addcol/v.db.addcol	2010-01-06 04:19:05 UTC (rev 40274)
@@ -78,34 +78,34 @@
 : ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
 
 # does map exist in CURRENT mapset?
-eval `g.findfile element=vector file=$GIS_OPT_MAP mapset=$MAPSET`
+eval `g.findfile element=vector file="$GIS_OPT_MAP" mapset="$MAPSET"`
 if [ ! "$file" ] ; then
    g.message "Vector map '$GIS_OPT_MAP' not found in current mapset"
    exit 1
 fi
 
-table=`v.db.connect $GIS_OPT_MAP -g fs=";" | grep -w $GIS_OPT_LAYER | awk -F ";" '{print $2}'`
+table=`v.db.connect "$GIS_OPT_MAP" -g fs=";" | grep -w "$GIS_OPT_LAYER" | awk -F ";" '{print $2}'`
 if [ -z "$table" ] ; then
    g.message -e 'There is no table connected to this map! Run v.db.connect or v.db.addtable first.'
    exit 1
 fi
 
-database=`v.db.connect $GIS_OPT_MAP -g fs=";" | grep -w $GIS_OPT_LAYER | awk -F ";" '{print $4}'`
-driver=`v.db.connect $GIS_OPT_MAP -g fs=";" | grep -w $GIS_OPT_LAYER | awk -F ";" '{print $5}'`
+database=`v.db.connect "$GIS_OPT_MAP" -g fs=";" | grep -w "$GIS_OPT_LAYER" | awk -F ";" '{print $4}'`
+driver=`v.db.connect "$GIS_OPT_MAP" -g fs=";" | grep -w "$GIS_OPT_LAYER" | awk -F ";" '{print $5}'`
 
-colnum=`echo $GIS_OPT_COLUMNS | awk -F, '{print NF}'`
+colnum=`echo "$GIS_OPT_COLUMNS" | awk -F, '{print NF}'`
 
 n=1
 while [ "$n" -le "$colnum" ]
   do
-    col=`echo $GIS_OPT_COLUMNS | cut -d',' -f$n`
+    col=`echo "$GIS_OPT_COLUMNS" | cut -d',' -f$n`
     
     if [ -z "$col" ] ; then
       g.message -e 'There is an empty column! Did you leave a trailing comma?'
       exit 1
     fi
 
-    echo "ALTER TABLE $table ADD COLUMN $col" | db.execute database="${database}" driver=${driver}
+    echo "ALTER TABLE $table ADD COLUMN $col" | db.execute database="${database}" driver="${driver}"
     if [ $? -eq 1 ] ; then
       g.message -e "Cannot continue (problem adding column)."
       exit 1
@@ -115,7 +115,7 @@
 
 
 # write cmd history:
-v.support ${GIS_OPT_MAP} cmdhist="${CMDLINE}"
+v.support "${GIS_OPT_MAP}" cmdhist="${CMDLINE}"
 
 exit 0
 



More information about the grass-commit mailing list