<br><font size=2 face="sans-serif">I need more help. &nbsp;I implemented
the suggestions from Glynn and edited the file in emacs. &nbsp;I no longer
receive any error messages but the script does not run any GRASS processes.
&nbsp;Here is the current version of the script. &nbsp;Obviously I am new
to this so I appreciate any help I can get. &nbsp;I have about 100 processes
to complete and a batch script is the only way I think I'll get it done.
&nbsp;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=&quot;$HOME/.grassrc6&quot;</font>
<br><font size=2 face="sans-serif">GISDBASE=&quot;/cygdrive/c/Data/WBEA&quot;</font>
<br><font size=2 face="sans-serif">GISBASE=&quot;/cygdrive/c/cygwin/usr/local/grass-6.2.2&quot;</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 &quot;GISDBASE: $GISDBASE</font>
<br><font size=2 face="sans-serif">LOCATION_NAME: newset</font>
<br><font size=2 face="sans-serif">MAPSET: PERMANENT&quot; &gt; $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=&quot;$PATH:$GISBASE/bin:$GISBASE/scripts&quot;</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 &lt;glynn@gclements.plus.com&gt;</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 &lt;shanser@usgs.gov&gt;</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>
&gt; I am trying to write a batch file for Cygwin that will run multiple
GRASS <br>
&gt; r.le.pixel commands, change the region, and rerun commands on the
new <br>
&gt; region. &nbsp;I have a simplified version based on a previous posting
to this <br>
&gt; listserv. &nbsp;I have tried using it under #!/bin/sh and #!/bin/ash
and <br>
&gt; receive error with both. &nbsp;Please help. &nbsp;Thank you.<br>
&gt; <br>
&gt; Under #!/bin/sh &nbsp;- &nbsp;Does not produce the testing.txt file<br>
&gt; <br>
&gt; $ ./batch-grass6v3.sh<br>
&gt; : No such file or directory4: testing.txt<br>
&gt; : No such file or directory5: testing.txt<br>
&gt; : No such file or directory6: testing.txt<br>
&gt; ': not a valid identifier 21: export: `GISBASE<br>
&gt; ': not a valid identifier 22: export: `GISRC<br>
&gt; ./batch-grass6v3.sh: line 25: $'g.version\r': command not found<br>
&gt; /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>
&gt; Under #!/bin/ash<br>
&gt; <br>
&gt; Produces the testing.txt file but nothing else.<br>
&gt; <br>
&gt; $ ./batch-grass6v3.sh<br>
&gt; export: Files/ATI: bad variable name<br>
&gt; g.version: not found<br>
&gt; <br>
&gt; Here is the current version of the script:<br>
<br>
&gt; GISRC=&quot;~/testing.txt&quot;<br>
<br>
The ~ character isn't expanded inside quotes. Use $HOME instead, i.e.:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
GISRC=&quot;$HOME/testing.txt&quot;<br>
<br>
&gt; echo $GISDBASE &gt; testing.txt<br>
<br>
I suggest adding quotes here, i.e.<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
echo &quot;$GISDBASE&quot; &gt; testing.txt<br>
<br>
&gt; export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts<br>
<br>
I strongly suggest adding quotes here. This is probably where the<br>
&quot;Files/ATI&quot; comes from (i.e. /cygdrive/c/Program Files/ATI gets
split<br>
at the space between Program and Files).<br>
<br>
-- <br>
Glynn Clements &lt;glynn@gclements.plus.com&gt;<br>
</tt></font>
<br>