[GRASS5] $GIS_OPT = "(null)" to "" in scripts

Hamish hamish_nospam at yahoo.com
Thu Jan 20 23:30:27 EST 2005


> > > scripts/i.oif/i.oifcalc
> > 
> > could someone test that one? There is this sort of thing:
> > 
> > awk '{print sum > "$temp_file"}'
> > 
> > which I am pretty sure will break but don't know enough awk to fix.
> 
> If you want to use shell variables in awk commands, the easiest way is
> probably to define a corresponding awk variable, e.g.
> 
> 	awk -v temp_file="$temp_file" ...
> 
> then use:
> 
> 	print sum > temp_file
> 
> within awk.


That did the trick, thanks.

i.oif is working again.


I also updated it to use r.univar (the C module) which should make it
a bit faster but gives slightly different answers too. The change is
on the order of 0.0005 though, shouldn't be important to the sort order.
Someone in the know might test to see if r.univar needs to report more
significant digits, etc?

I don't have any tests from before the updates -- all I know is that it
outputs some numbers. Could someone who knows LANDSAT test & see that
they still mean something? (I do know that d.rgb of my highest scoring
results produced a *really* nice false color satellite image)




Hamish




More information about the grass-dev mailing list