[GRASS-SVN] r45614 - in grass/branches/develbranch_6/scripts:
g.mremove i.image.mosaic i.oif r.plane v.build.all
v.convert.all v.db.reconnect.all v.in.mapgen v.in.sites.all v.report
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Mar 9 02:19:27 EST 2011
Author: hamish
Date: 2011-03-08 23:19:27 -0800 (Tue, 08 Mar 2011)
New Revision: 45614
Modified:
grass/branches/develbranch_6/scripts/g.mremove/g.mremove
grass/branches/develbranch_6/scripts/i.image.mosaic/i.image.mosaic
grass/branches/develbranch_6/scripts/i.oif/i.oif
grass/branches/develbranch_6/scripts/r.plane/r.plane
grass/branches/develbranch_6/scripts/v.build.all/v.build.all
grass/branches/develbranch_6/scripts/v.convert.all/v.convert.all
grass/branches/develbranch_6/scripts/v.db.reconnect.all/v.db.reconnect.all
grass/branches/develbranch_6/scripts/v.in.mapgen/v.in.mapgen
grass/branches/develbranch_6/scripts/v.in.sites.all/v.in.sites.all
grass/branches/develbranch_6/scripts/v.report/v.report
Log:
variable quoting
Modified: grass/branches/develbranch_6/scripts/g.mremove/g.mremove
===================================================================
--- grass/branches/develbranch_6/scripts/g.mremove/g.mremove 2011-03-09 06:57:31 UTC (rev 45613)
+++ grass/branches/develbranch_6/scripts/g.mremove/g.mremove 2011-03-09 07:19:27 UTC (rev 45614)
@@ -99,7 +99,7 @@
eval `g.gisenv`
: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
+LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
PROG=`basename "$0"`
@@ -111,20 +111,20 @@
regex=""
fi
-force=$GIS_FLAG_F
+force="$GIS_FLAG_F"
if [ $force -eq 1 ] ; then
g.message "Forcing ..."
fi
-r=$GIS_OPT_RAST
-r3=$GIS_OPT_RAST3D
-v=$GIS_OPT_VECT
-i=$GIS_OPT_ICON
-l=$GIS_OPT_LABEL
-rg=$GIS_OPT_REGION
-g=$GIS_OPT_GROUP
-d=$GIS_OPT_DVIEW
+r="$GIS_OPT_RAST"
+r3="$GIS_OPT_RAST3D"
+v="$GIS_OPT_VECT"
+i="$GIS_OPT_ICON"
+l="$GIS_OPT_LABEL"
+rg="$GIS_OPT_REGION"
+g="$GIS_OPT_GROUP"
+d="$GIS_OPT_DVIEW"
if [ -n "$r" ] ; then
rast=`g.mlist $regex type=rast sep=, mapset=$MAPSET pattern="$r"`
Modified: grass/branches/develbranch_6/scripts/i.image.mosaic/i.image.mosaic
===================================================================
--- grass/branches/develbranch_6/scripts/i.image.mosaic/i.image.mosaic 2011-03-09 06:57:31 UTC (rev 45613)
+++ grass/branches/develbranch_6/scripts/i.image.mosaic/i.image.mosaic 2011-03-09 07:19:27 UTC (rev 45614)
@@ -84,7 +84,7 @@
eval `g.gisenv`
: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-CURRLOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
+CURRLOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
g.message -w message='Do not forget to set region properly to cover all images!'
Modified: grass/branches/develbranch_6/scripts/i.oif/i.oif
===================================================================
--- grass/branches/develbranch_6/scripts/i.oif/i.oif 2011-03-09 06:57:31 UTC (rev 45613)
+++ grass/branches/develbranch_6/scripts/i.oif/i.oif 2011-03-09 07:19:27 UTC (rev 45614)
@@ -86,7 +86,7 @@
eval `g.gisenv`
: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
+LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
# Open tempfiles
temp_stddev="`g.tempfile $$`"
Modified: grass/branches/develbranch_6/scripts/r.plane/r.plane
===================================================================
--- grass/branches/develbranch_6/scripts/r.plane/r.plane 2011-03-09 06:57:31 UTC (rev 45613)
+++ grass/branches/develbranch_6/scripts/r.plane/r.plane 2011-03-09 07:19:27 UTC (rev 45614)
@@ -103,30 +103,30 @@
### setup enviro vars ###
eval `g.gisenv`
: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
+LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
-dip=$GIS_OPT_DIP
-az=$GIS_OPT_AZIMUTH
-ea=$GIS_OPT_EASTING
-no=$GIS_OPT_NORTHING
-el=$GIS_OPT_ELEVATION
+dip="$GIS_OPT_DIP"
+az="$GIS_OPT_AZIMUTH"
+ea="$GIS_OPT_EASTING"
+no="$GIS_OPT_NORTHING"
+el="$GIS_OPT_ELEVATION"
name="$GIS_OPT_NAME"
-type=$GIS_OPT_TYPE
+type="$GIS_OPT_TYPE"
eval `g.region -g`
### test input values ###
-diptest=`echo $dip | awk '{ printf("%8d", int($1 + 0.5))'}`
-if [ $diptest -lt -90 -o $diptest -gt 90 ]
+diptest=`echo "$dip" | awk '{ printf("%8d", int($1 + 0.5))'}`
+if [ "$diptest" -lt -90 -o "$diptest" -gt 90 ]
then
g.message -e "Sorry, dip must be greater than -90 and less than 90.\
Please enter a valid value."
exit 1
fi
-aztest=`echo $az | awk '{ printf("%8d", int($1 + 0.5))'}`
-if [ $aztest -lt 0 -o $aztest -ge 360 ]
+aztest=`echo "$az" | awk '{ printf("%8d", int($1 + 0.5))'}`
+if [ "$aztest" -lt 0 -o "$aztest" -ge 360 ]
then
g.message -e "Sorry, azimuth must be no less than 0 and less than 360"
exit 1
@@ -154,8 +154,8 @@
fi
# these tests will fail for negative lat/lon?
-eaint=`echo $ea | awk '{ printf "%d",int($1 + 0.5) }'`
-if test $eaint -le `echo $e | cut -d. -f1` -a $eaint -ge `echo $w | cut -d. -f1`
+eaint=`echo "$ea" | awk '{ printf "%d",int($1 + 0.5) }'`
+if test "$eaint" -le `echo "$e" | cut -d. -f1` -a "$eaint" -ge `echo "$w" | cut -d. -f1`
then
gotit=1
# echo "east: $ea"
@@ -166,8 +166,8 @@
exit 1
fi
-noint=`echo $no | awk '{ printf "%d", int($1 + 0.5) }'`
-if test $noint -gt `echo $s | cut -d. -f1` -a $noint -lt `echo $n | cut -d. -f1`
+noint=`echo "$no" | awk '{ printf "%d", int($1 + 0.5) }'`
+if test "$noint" -gt `echo "$s" | cut -d. -f1` -a "$noint" -lt `echo "$n" | cut -d. -f1`
then
gotit=1
# echo "north: $no"
@@ -254,8 +254,8 @@
g.message "Running r.in.ascii, please stand by.."
r.in.ascii `echo $typeflag` i="$TEMPFILE".2 o=$name
-r.support $name hist="$PROG name=$name dip=$dip azimuth=$az easting=$ea \\"
-r.support $name hist="northing=$no elevation=$el type=$type"
+r.support "$name" hist="$PROG name=$name dip=$dip azimuth=$az easting=$ea \\"
+r.support "$name" hist="northing=$no elevation=$el type=$type"
g.message "Done."
g.message message="Raster map <$name@$MAPSET> generated by r.plane \
Modified: grass/branches/develbranch_6/scripts/v.build.all/v.build.all
===================================================================
--- grass/branches/develbranch_6/scripts/v.build.all/v.build.all 2011-03-09 06:57:31 UTC (rev 45613)
+++ grass/branches/develbranch_6/scripts/v.build.all/v.build.all 2011-03-09 07:19:27 UTC (rev 45614)
@@ -31,10 +31,10 @@
eval `g.gisenv`
: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
+LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
-for VECT in `g.list type=vect mapset=${MAPSET} | sed 1,2d | grep -v '^-*$'`
+for VECT in `g.list type=vect mapset="$MAPSET" | sed 1,2d | grep -v '^-*$'`
do
g.message "Build topology for vector '${VECT}@${MAPSET}'"
CMD="v.build map=${VECT}@${MAPSET}"
Modified: grass/branches/develbranch_6/scripts/v.convert.all/v.convert.all
===================================================================
--- grass/branches/develbranch_6/scripts/v.convert.all/v.convert.all 2011-03-09 06:57:31 UTC (rev 45613)
+++ grass/branches/develbranch_6/scripts/v.convert.all/v.convert.all 2011-03-09 07:19:27 UTC (rev 45614)
@@ -36,7 +36,7 @@
eval `g.gisenv`
: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
+LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
CONVERTEDMAPS=0
for i in `g.mlist type=oldvect`
@@ -44,10 +44,10 @@
# polish map names to be SQL compliant
INPUT=$i
- OUTPUT=`echo $INPUT | sed 's+\.+_+g'`
+ OUTPUT=`echo "$INPUT" | sed 's+\.+_+g'`
#do it:
- v.convert in=$INPUT out=$OUTPUT
+ v.convert in="$INPUT" out="$OUTPUT"
if [ $? -ne 0 ] ; then
g.message -e "Converting map $INPUT to $OUTPUT"
else
@@ -55,7 +55,7 @@
fi
done
-if [ $CONVERTEDMAPS -lt 1 ] ; then
+if [ "$CONVERTEDMAPS" -lt 1 ] ; then
g.message -w "No vector maps converted as no old vector maps present in current mapset <$MAPSET>."
else
g.message "Total $CONVERTEDMAPS number of vector maps in current mapset converted."
Modified: grass/branches/develbranch_6/scripts/v.db.reconnect.all/v.db.reconnect.all
===================================================================
--- grass/branches/develbranch_6/scripts/v.db.reconnect.all/v.db.reconnect.all 2011-03-09 06:57:31 UTC (rev 45613)
+++ grass/branches/develbranch_6/scripts/v.db.reconnect.all/v.db.reconnect.all 2011-03-09 07:19:27 UTC (rev 45614)
@@ -49,16 +49,16 @@
eval `g.gisenv`
: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
+LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
if [ "$1" != "@ARGS_PARSED@" ] ; then
exec g.parser "$0" "$@"
fi
-OLD_DATABASE=$GIS_OPT_OLD_DATABASE
-NEW_DATABASE=$GIS_OPT_NEW_DATABASE
-OLD_SCHEMA=$GIS_OPT_OLD_SCHEMA
-NEW_SCHEMA=$GIS_OPT_NEW_SCHEMA
+OLD_DATABASE="$GIS_OPT_OLD_DATABASE"
+NEW_DATABASE="$GIS_OPT_NEW_DATABASE"
+OLD_SCHEMA="$GIS_OPT_OLD_SCHEMA"
+NEW_SCHEMA="$GIS_OPT_NEW_SCHEMA"
if [ -z "$OLD_DATABASE" ] ; then
g.message -e "Old database not specified"
@@ -70,19 +70,19 @@
exit 1
fi
-for VECT in `g.list type=vect mapset=${MAPSET} | sed 1,2d | grep -v '^-*$'`
+for VECT in `g.list type=vect mapset="$MAPSET" | sed 1,2d | grep -v '^-*$'`
do
g.message message="Reconnecting vector '${VECT}@${MAPSET}'"
for LINK in `v.db.connect -g fs="|" map=${VECT}@${MAPSET}` ; do
- eval `echo $LINK | sed 's$\([^\|]*\)|\([^\|]*\)|\([^\|]*\)|\([^\|]*\)|\([^\|]*\)$LAYER=\1 SCHEMA_TABLE=\2 KEY=\3 DATABASE=\4 DRIVER=\5$'`
+ eval `echo "$LINK" | sed 's$\([^\|]*\)|\([^\|]*\)|\([^\|]*\)|\([^\|]*\)|\([^\|]*\)$LAYER=\1 SCHEMA_TABLE=\2 KEY=\3 DATABASE=\4 DRIVER=\5$'`
- SCHEMA=`echo $SCHEMA_TABLE | grep '\.' | sed 's/\([^.]*\)\..*/\1/'`
- TABLE=`echo $SCHEMA_TABLE | sed 's/.*\.//'`
+ SCHEMA=`echo "$SCHEMA_TABLE" | grep '\.' | sed 's/\([^.]*\)\..*/\1/'`
+ TABLE=`echo "$SCHEMA_TABLE" | sed 's/.*\.//'`
if [ -n "$NEW_SCHEMA" ] ; then
NEW_SCHEMA_TABLE="${NEW_SCHEMA}.${TABLE}"
else
- NEW_SCHEMA_TABLE="${TABLE}"
+ NEW_SCHEMA_TABLE="$TABLE"
fi
g.message message="SCHEMA = $SCHEMA TABLE = $TABLE NEW_SCHEMA_TABLE=$NEW_SCHEMA_TABLE"
Modified: grass/branches/develbranch_6/scripts/v.in.mapgen/v.in.mapgen
===================================================================
--- grass/branches/develbranch_6/scripts/v.in.mapgen/v.in.mapgen 2011-03-09 06:57:31 UTC (rev 45613)
+++ grass/branches/develbranch_6/scripts/v.in.mapgen/v.in.mapgen 2011-03-09 07:19:27 UTC (rev 45614)
@@ -74,7 +74,7 @@
eval `g.gisenv`
: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
+LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
OPTS=""
@@ -162,7 +162,7 @@
cat "${TMPFILE}" >> "${TMPFILE}.dig"
#### if no name for vector file given, cat to stdout
-if [ "$NAME" = "" ] ; then
+if [ -z "$NAME" ] ; then
g.message "Output to stdout"
cat "${TMPFILE}.dig" 2>/dev/null
else
Modified: grass/branches/develbranch_6/scripts/v.in.sites.all/v.in.sites.all
===================================================================
--- grass/branches/develbranch_6/scripts/v.in.sites.all/v.in.sites.all 2011-03-09 06:57:31 UTC (rev 45613)
+++ grass/branches/develbranch_6/scripts/v.in.sites.all/v.in.sites.all 2011-03-09 07:19:27 UTC (rev 45614)
@@ -34,19 +34,19 @@
eval `g.gisenv`
: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
+LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
CONVERTEDMAPS=0
for i in `g.mlist type=sites mapset=.`
do
# polish map names to be SQL compliant
- INPUT=$i
- OUTPUT=`echo $INPUT | sed 's+\.+_+g'`_points
+ INPUT="$i"
+ OUTPUT=`echo "$INPUT" | sed 's+\.+_+g'`_points
#do it:
g.message "Processing $INPUT -> $OUTPUT"
- v.in.sites in=$INPUT out=$OUTPUT
+ v.in.sites in="$INPUT" out="$OUTPUT"
if [ $? -ne 0 ] ; then
g.message -w "Error converting map $INPUT to $OUTPUT"
else
@@ -54,7 +54,7 @@
fi
done
-if [ $CONVERTEDMAPS -lt 1 ] ; then
+if [ "$CONVERTEDMAPS" -lt 1 ] ; then
g.message -e "No sites maps converted as no old sites maps present in current mapset <$MAPSET>."
else
g.message "Total $CONVERTEDMAPS number of sites maps in current mapset converted to vector"
Modified: grass/branches/develbranch_6/scripts/v.report/v.report
===================================================================
--- grass/branches/develbranch_6/scripts/v.report/v.report 2011-03-09 06:57:31 UTC (rev 45613)
+++ grass/branches/develbranch_6/scripts/v.report/v.report 2011-03-09 07:19:27 UTC (rev 45614)
@@ -72,7 +72,7 @@
### setup enviro vars ###
eval `g.gisenv`
: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
+LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
### trap <ctrl>-<c> so that we can clean up tmp and exit
trap 'rm -f "$TMP1" "$TMP2" "$TMP3" "$TMP4"; exit 1' 2 3 15
More information about the grass-commit
mailing list