[GRASS-user] Running Scripts in GRASS

Andrew Lewin andrew.lewin at sympatico.ca
Wed Aug 19 09:01:12 EDT 2009


I found the solution...again, I had to ensure that the program was reading from the correct path.

Andrew

From: andrew.lewin at sympatico.ca
To: hamish_b at yahoo.com; neteler at osgeo.org
Subject: RE: [GRASS-user] Running Scripts in GRASS
Date: Wed, 19 Aug 2009 12:47:51 +0000
CC: grass-user at lists.osgeo.org








Thanks to all of you who helped solve my problem.

I was able to run the script from the folder where the files I needed to process were stored.  

I still have to tweak the script as the program says that it doesn't recognize "*".  The script uses the "*" symbol in the following manner:

for file in A*_MO_CHLO_4 ; do
  echo "map: $file"

  gdal_translate -a_srs "+init=epsg:4326" -a_nodata 65535 \
    -a_ullr -180 90 180 -90 -co "COMPRESS=PACKBITS" \
    $file ${file}_prep.tif

  r.in.gdal in=${file}_prep.tif out=$file
done
Can anyone tell me the language the program is in?  I am not familiar with it and it would be good to know more about it.

Thanks again for your help.

Andrew

> Date: Tue, 18 Aug 2009 18:04:59 -0700
> From: hamish_b at yahoo.com
> Subject: Re: [GRASS-user] Running Scripts in GRASS
> To: andrew.lewin at sympatico.ca; neteler at osgeo.org
> CC: grass-user at lists.osgeo.org
> 
> Markus wrote:
> > Perhaps we should cook up a Wiki page describing this briefly?
> 
> 
> shrug. or as it's an external task, delegate the matter and add a link to some good document on the web about unix shell scripting. I'm sure there are many out there already. (but
> whatever)
> 
> 
> Andrew, another thing to realize is that these are just terminal prompt commands strung together via cut and paste into a file.
> 
> Also the wiki instructions were not written with a script in mind, so you will probably have to adjust a few filenames etc by hand.
> 
> I just updated the simple XY method example to use the new
> 'r.in.gdal -l' directly into a lat/lon location, but I think
> the gdal_translate method is better.
> 
> 
> typically shell scripts are given a shebang line which looks
> like:
> 
> #!/bin/sh
> 
> this tells the OS that when you run the program it should use
> the shell program (found in /bin/sh) to run it.
> 
> 
> 
> Hamish
> 
> 
> 
>       
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20090819/fc8fa823/attachment.html


More information about the grass-user mailing list