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

Andrew

From: [email protected]
To: [email protected]; [email protected]
Subject: RE: [GRASS-user] Running Scripts in GRASS
Date: Wed, 19 Aug 2009 12:47:51 +0000
CC: [email protected]








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: [email protected]
> Subject: Re: [GRASS-user] Running Scripts in GRASS
> To: [email protected]; [email protected]
> CC: [email protected]
> 
> 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
> 
> 
> 
>       
> 
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to