<br><font size=2 face="sans-serif">I need more help. I implemented
the suggestions from Glynn and edited the file in emacs. I no longer
receive any error messages but the script does not run any GRASS processes.
Here is the current version of the script. Obviously I am new
to this so I appreciate any help I can get. I have about 100 processes
to complete and a batch script is the only way I think I'll get it done.
Thank you.</font>
<br>
<br><font size=2 face="sans-serif">#!/bin/sh</font>
<br><font size=2 face="sans-serif">#customize this:</font>
<br><font size=2 face="sans-serif">#</font>
<br><font size=2 face="sans-serif">GISRC="$HOME/.grassrc6"</font>
<br><font size=2 face="sans-serif">GISDBASE="/cygdrive/c/Data/WBEA"</font>
<br><font size=2 face="sans-serif">GISBASE="/cygdrive/c/cygwin/usr/local/grass-6.2.2"</font>
<br><font size=2 face="sans-serif"># Generate Grass settings:</font>
<br><font size=2 face="sans-serif">#</font>
<br><font size=2 face="sans-serif">echo "GISDBASE: $GISDBASE</font>
<br><font size=2 face="sans-serif">LOCATION_NAME: newset</font>
<br><font size=2 face="sans-serif">MAPSET: PERMANENT" > $HOME/.grassrc6</font>
<br><font size=2 face="sans-serif">#</font>
<br><font size=2 face="sans-serif"># Exports</font>
<br><font size=2 face="sans-serif">#</font>
<br><font size=2 face="sans-serif">#</font>
<br><font size=2 face="sans-serif">export LD_LIBRARY_PATH=/cygdrive/c/cygwin/lib:$GISBASE/lib:$LD_LIBRARY_PATH</font>
<br><font size=2 face="sans-serif">export GISRC=$HOME/.grassrc6</font>
<br><font size=2 face="sans-serif">export PATH="$PATH:$GISBASE/bin:$GISBASE/scripts"</font>
<br><font size=2 face="sans-serif">export GIS_LOCK=$$</font>
<br><font size=2 face="sans-serif">r.le.pixel map=bigsage sam=m att=b4
te1=m7 te2=t1,t2 edg=e1</font>
<br><font size=2 face="sans-serif">#</font>
<br><font size=2 face="sans-serif"># CleanupandExit</font>
<br><font size=2 face="sans-serif">#</font>
<br><font size=2 face="sans-serif">$GISBASE/etc/clean_temp</font>
<br><font size=2 face="sans-serif">rm -rf /cygdrive/c/cygwin/tmp/grass6-$USER-$GIS_LOCK</font>
<br><font size=2 face="sans-serif">rm -f $GISRC</font>
<br>
<br><font size=2 face="sans-serif">Steve Hanser<br>
Wildlife Biologist / GIS Specialist<br>
USGS, FRESC, Snake River Field Station<br>
970 Lusk St. Boise, ID 83706<br>
PH: 208-426-2892 FAX: 208-426-5210</font>
<br>
<br><font size=2 face="sans-serif">Steve Hanser<br>
Wildlife Biologist / GIS Specialist<br>
USGS, FRESC, Snake River Field Station<br>
970 Lusk St. Boise, ID 83706<br>
PH: 208-426-2892 FAX: 208-426-5210</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Glynn Clements <glynn@gclements.plus.com></b>
</font>
<p><font size=1 face="sans-serif">08/08/2007 02:05 PM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Steve Hanser <shanser@usgs.gov></font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">grassuser@grass.itc.it</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [GRASS-user] Batch Processing in
GRASS 6.2 w/ Cygwin</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt><br>
Steve Hanser wrote:<br>
<br>
> I am trying to write a batch file for Cygwin that will run multiple
GRASS <br>
> r.le.pixel commands, change the region, and rerun commands on the
new <br>
> region. I have a simplified version based on a previous posting
to this <br>
> listserv. I have tried using it under #!/bin/sh and #!/bin/ash
and <br>
> receive error with both. Please help. Thank you.<br>
> <br>
> Under #!/bin/sh - Does not produce the testing.txt file<br>
> <br>
> $ ./batch-grass6v3.sh<br>
> : No such file or directory4: testing.txt<br>
> : No such file or directory5: testing.txt<br>
> : No such file or directory6: testing.txt<br>
> ': not a valid identifier 21: export: `GISBASE<br>
> ': not a valid identifier 22: export: `GISRC<br>
> ./batch-grass6v3.sh: line 25: $'g.version\r': command not found<br>
> /etc/clean_temp: No such file or directoryrass-6.2.2<br>
<br>
Your script appears to be using CRLF line termination; you need to use<br>
LF (the CR will be treated literally, causing all kinds of errors).<br>
<br>
This rules out using Notepad to edit scripts. Cygwin has packages for<br>
vim, emacs and xemacs.<br>
<br>
> Under #!/bin/ash<br>
> <br>
> Produces the testing.txt file but nothing else.<br>
> <br>
> $ ./batch-grass6v3.sh<br>
> export: Files/ATI: bad variable name<br>
> g.version: not found<br>
> <br>
> Here is the current version of the script:<br>
<br>
> GISRC="~/testing.txt"<br>
<br>
The ~ character isn't expanded inside quotes. Use $HOME instead, i.e.:<br>
<br>
GISRC="$HOME/testing.txt"<br>
<br>
> echo $GISDBASE > testing.txt<br>
<br>
I suggest adding quotes here, i.e.<br>
<br>
echo "$GISDBASE" > testing.txt<br>
<br>
> export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts<br>
<br>
I strongly suggest adding quotes here. This is probably where the<br>
"Files/ATI" comes from (i.e. /cygdrive/c/Program Files/ATI gets
split<br>
at the space between Program and Files).<br>
<br>
-- <br>
Glynn Clements <glynn@gclements.plus.com><br>
</tt></font>
<br>