[GRASS-SVN] r53121 - grass-addons/grass6/raster/r.connectivity.distance
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Sep 7 02:46:22 PDT 2012
Author: sbl
Date: 2012-09-07 02:46:21 -0700 (Fri, 07 Sep 2012)
New Revision: 53121
Modified:
grass-addons/grass6/raster/r.connectivity.distance/r.connectivity.distance
Log:
Fix 'sed -i' not working on Windows
Modified: grass-addons/grass6/raster/r.connectivity.distance/r.connectivity.distance
===================================================================
--- grass-addons/grass6/raster/r.connectivity.distance/r.connectivity.distance 2012-09-07 09:17:25 UTC (rev 53120)
+++ grass-addons/grass6/raster/r.connectivity.distance/r.connectivity.distance 2012-09-07 09:46:21 UTC (rev 53121)
@@ -386,8 +386,8 @@
elif [ $centroid_number -eq 0 ] ; then
g.remove -f vect=${PREFIX}_patch_${p} --quiet 2>&1 > /dev/null
echo "${p};no centroid" >> ${FOLDER}/unconsidered_patches.csv
- sed -i "/^${p};/d" ${FOLDER}/vertices_part_1.csv
- sed -i "/^${p};/d" ${FOLDER}/vertices_part_2.csv
+ cat ${FOLDER}/vertices_part_1.csv | sed "/^${p};/d" > ${FOLDER}/vertices_part_1.csv
+ cat ${FOLDER}/vertices_part_2.csv | sed "/^${p};/d" > ${FOLDER}/vertices_part_2.csv
g.message -w "Patch ${p} has no centroid and is therefor not considered in anaysis. Consider cleaning your input data..."
continue
fi
@@ -410,8 +410,8 @@
if [ "$min" = "NULL" ] ; then
g.remove -f vect=${PREFIX}_patch_${p} rast=${PREFIX}_patch_${p} --quiet 2>&1 > /dev/null
echo "${p};not rasterised" >> ${FOLDER}/unconsidered_patches.csv
- sed -i "/^${p};/d" ${FOLDER}/vertices_part_1.csv
- sed -i "/^${p};/d" ${FOLDER}/vertices_part_2.csv
+ cat ${FOLDER}/vertices_part_1.csv | sed "/^${p};/d" > ${FOLDER}/vertices_part_1.csv
+ cat ${FOLDER}/vertices_part_2.csv | sed "/^${p};/d" > ${FOLDER}/vertices_part_2.csv
g.message -w "Patch ${p} was not rasterised and is therefor not considered in anaysis. Consider adjusting region resolution..."
continue
fi
@@ -566,7 +566,7 @@
done
#Remove external temporary data
-if [ -z "$FOLDER" ] ; then
+if [ "$FOLDER" ] ; then
rm -f ${FOLDER}/tmp
rm -f ${FOLDER}/tmp_part
else
More information about the grass-commit
mailing list