[Qgis-user] shell script problem

Kirk Wythers kirk.wythers at gmail.com
Thu Sep 13 15:09:22 PDT 2012


My apologies. I didn't realize I had posted to the egis list. This was intended for the grass list. I discovered the problem earlier today. It turned out to be a meta character that was not showing up in my text editor. Looks it is time to go back to vi… pain to use, but shows all weird characters that, for some reason, emacs did not. 


Best,

Kirk

> On Sep 13, 2012 3:33 PM, "Kirk Wythers" <kirk.wythers at gmail.com> wrote:
> I am perplexed by some odd scripting behavior and am hoping that someone can point out the (probably stupid) mistake I am making.
> 
> I use a simple for loop with g.mlist an r.what to query some climate data. I have run this script before and never had any trouble with it. However, today I notice that it is returning fewer data points from my climate data than the number of coordinates that I am querying. For example I have a file "coords" that contains 8973 lines of coordinates. This should return 8973 lines of data from grass. However, the script is returning 8925 lines of data. I'm not getting any errors and can think of no reason the script should behave this way.
> 
> Any ideas?
> 
> 
> 
> Here is a copy of my shell script
> 
> #!/bin/bash
> 
> #test to see if script is being run from GRASS
> 
> if test "$GISBASE" = ""; then
>         echo "You must be in GRASS to run this program"
>         exit
> fi
> 
> # Use input text file for coords in the format: lon lat (easting northing) single
> # space between coords. Example: -98.42072 55.91481. Must use real coordinates, no blanks.
> # Script will create file for each $MAP in the list. g.mlist can also take the "pattern"
> # argument which takes regular expressions. For example: pattern="*" returns all
> # maps in the database.
> 
> for MAP in `g.mlist type=rast pattern="HIST_bio_12"`; do
>     r.what --verbose input="$MAP" < ~/Desktop/worldclim/coords > ~/Desktop/worldclim/"$MAP".txt;
> 
> echo "$MAP"
> 
> done
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20120913/2a5bfbde/attachment.html>


More information about the Qgis-user mailing list