[GRASS-SVN] r59232 - grass/branches/releasebranch_6_4/scripts/i.oif
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Mar 10 17:48:10 PDT 2014
Author: hamish
Date: 2014-03-10 17:48:10 -0700 (Mon, 10 Mar 2014)
New Revision: 59232
Modified:
grass/branches/releasebranch_6_4/scripts/i.oif/i.oifcalc
Log:
fix for WinGRASS: move temp filename out of awk, backslashes in the path were being treated as quoting chars (merge from devbr6)
Modified: grass/branches/releasebranch_6_4/scripts/i.oif/i.oifcalc
===================================================================
--- grass/branches/releasebranch_6_4/scripts/i.oif/i.oifcalc 2014-03-10 23:15:54 UTC (rev 59231)
+++ grass/branches/releasebranch_6_4/scripts/i.oif/i.oifcalc 2014-03-11 00:48:10 UTC (rev 59232)
@@ -33,26 +33,26 @@
"$GISBASE"/etc/i.oif/m.cutmatrix "$temp_stddev" 1 $2 >> "$temp_sum"
"$GISBASE"/etc/i.oif/m.cutmatrix "$temp_stddev" 1 $3 >> "$temp_sum"
-cat "$temp_sum" | awk -v temp_file="$temp_calc" \
+cat "$temp_sum" | awk \
'BEGIN {sum = 0.0}
NR == 1{}
{sum += $1 ; N++}
END{
-print sum > temp_file
-}'
+print sum
+}' > "$temp_calc"
# calculate SUM of absolute(Correlation values):
"$GISBASE"/etc/i.oif/m.cutmatrix "$temp_correlation" $1 $2 > "$temp_sum"
"$GISBASE"/etc/i.oif/m.cutmatrix "$temp_correlation" $1 $3 >> "$temp_sum"
"$GISBASE"/etc/i.oif/m.cutmatrix "$temp_correlation" $2 $3 >> "$temp_sum"
-cat "$temp_sum" | awk -v temp_file="$temp_calc" \
+cat "$temp_sum" | awk \
'BEGIN {sum = 0.0}
NR == 1{}
{sum += sqrt($1*$1) ; N++} # sqrt(x^2) is my ABS-function
END{
-print sum >> temp_file
-}'
+print sum
+}' >> "$temp_calc"
# Calculate OIF index:
# Divide (SUM of Stddeviations) and (SUM of Correlation)
More information about the grass-commit
mailing list