[GRASS-SVN] r30438 - grass/trunk/scripts/v.db.renamecol

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 3 06:41:21 EST 2008


Author: msieczka
Date: 2008-03-03 06:41:20 -0500 (Mon, 03 Mar 2008)
New Revision: 30438

Modified:
   grass/trunk/scripts/v.db.renamecol/v.db.renamecol
Log:
Single-quote if possible.
Messages standarization.

Modified: grass/trunk/scripts/v.db.renamecol/v.db.renamecol
===================================================================
--- grass/trunk/scripts/v.db.renamecol/v.db.renamecol	2008-03-03 10:15:38 UTC (rev 30437)
+++ grass/trunk/scripts/v.db.renamecol/v.db.renamecol	2008-03-03 11:41:20 UTC (rev 30438)
@@ -47,7 +47,7 @@
 #%end
 
 if [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
+    echo 'You must be in GRASS GIS to run this program.' >&2
     exit 1
 fi
 
@@ -66,7 +66,7 @@
 #### setup temporary file
 TMP="`g.tempfile pid=$$`"
 if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-    g.message -e "Unable to create temporary files."
+    g.message -e 'Unable to create temporary files.'
     exit 1
 fi
 
@@ -87,7 +87,7 @@
 
 error()
 {
-  g.message -e "Cannot continue (problem renaming column)."
+  g.message -e 'Cannot continue (problem renaming column).'
   cleanup
   exit 1
 }
@@ -98,20 +98,20 @@
 # does map exist in CURRENT mapset?
 eval `g.findfile element=vector file="$GIS_OPT_MAP" mapset="$MAPSET"`
 if [ ! "$file" ] ; then
-   g.message -e  "Vector map '$GIS_OPT_MAP' not found in current mapset."
+   g.message -e  "Vector map <$GIS_OPT_MAP> not found in current mapset."
    exit 1
 fi
 
-table=`v.db.connect -g map="$GIS_OPT_MAP" | grep -w "$GIS_OPT_LAYER" | cut -f2 -d" "`
+table=`v.db.connect -g map="$GIS_OPT_MAP" | grep -w "$GIS_OPT_LAYER" | cut -f2 -d' '`
 if [ -z "$table" ] ; then
-   g.message -e "There is no table connected to input vector map! Cannot rename any column."
+   g.message -e 'There is no table connected to the input vector map! Cannot rename any column.'
    cleanup
    exit 1
 fi
 
-keycol=`v.db.connect -g map=$GIS_OPT_MAP | grep -w $GIS_OPT_LAYER | cut -f3 -d" "`
-database=`v.db.connect -g map="$GIS_OPT_MAP" | grep -w $GIS_OPT_LAYER | cut -f4 -d" "`
-driver=`v.db.connect -g map="$GIS_OPT_MAP" | grep -w $GIS_OPT_LAYER | cut -f5 -d" "`
+keycol=`v.db.connect -g map="$GIS_OPT_MAP" | grep -w $GIS_OPT_LAYER | cut -f3 -d' '`
+database=`v.db.connect -g map="$GIS_OPT_MAP" | grep -w $GIS_OPT_LAYER | cut -f4 -d' '`
+driver=`v.db.connect -g map="$GIS_OPT_MAP" | grep -w $GIS_OPT_LAYER | cut -f5 -d' '`
 oldcol="`echo $GIS_OPT_COLUMN | cut -d',' -f1`"
 newcol="`echo $GIS_OPT_COLUMN | cut -d',' -f2`"
 
@@ -135,7 +135,7 @@
 fi
 
 # old col there?
-v.info --quiet -c "$GIS_OPT_MAP" layer=$GIS_OPT_LAYER | cut -d'|' -f1,2 | grep "|${oldcol}$" 2>&1 >/dev/null
+v.info --quiet -c map="$GIS_OPT_MAP" layer=$GIS_OPT_LAYER | cut -d'|' -f1,2 | grep "|${oldcol}$" 2>&1 >/dev/null
 if [ $? -ne 0 ] ; then
 	g.message -e "Column <$oldcol> not found in table."
 	cleanup



More information about the grass-commit mailing list