<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="GENERATOR" content="MSHTML 9.00.8112.16520">
</head>
<body>
<div><font size="2" face="Arial"><span class="492162711-03122013">Hello,  I can't seem to change the search path in GRASS 6.4.3, Windows 7, installed with the QGIS 2.0 bundle.  To walk through my steps so far...</span></font></div>
<div><font size="2" face="Arial"><span class="492162711-03122013">I have a bash script example below called myscript.sh.  It comes from
<a href="http://grasswiki.osgeo.org/wiki/MODIS#MODIS_Aqua">http://grasswiki.osgeo.org/wiki/MODIS#MODIS_Aqua</a></span></font></div>
<div><font face="Arial"><font size="2"><font size="2" face="Arial"><span class="492162711-03122013"></span></font></font></font> </div>
<div><font size="2" face="Arial"><span class="492162711-03122013">##################<br>
#!/bin/sh</span></font><span class="492162711-03122013"></div>
<div><font size="2" face="Arial">for file in A*SST_4 ; do </font></div>
<div><font face="Arial"><font size="2"><span class="492162711-03122013">    </span>
echo "map: $file"  </font></font></div>
<div><font face="Arial"><font size="2"><span class="492162711-03122013">    </span>
gdal_translate -a_srs "+init=epsg:4326" -a_nodata 65535 \    </font></font></div>
<div><font face="Arial"><font size="2"><span class="492162711-03122013">    </span>
-a_ullr -180 90 180 -90 -co "COMPRESS=PACKBITS" \    </font></font></div>
<div><font face="Arial"><font size="2"><span class="492162711-03122013">    </span>
HDF4_SDS:UNKNOWN:"$file":0 ${file}_prep.tif  </font></font></div>
<div><font face="Arial"><font size="2"><span class="492162711-03122013">    </span>
r.in.gdal in=${file}_prep.tif out=$file</font></font></div>
<div><font face="Arial"><font size="2">done</font></font></div>
<div></span><font size="2" face="Arial"><span class="492162711-03122013">##################</span></font></div>
<div><font size="2" face="Arial"><span class="492162711-03122013"></span></font> </div>
<div><font size="2" face="Arial"><span class="492162711-03122013">The script and data files (with the pattern A*SST_4) are stored in  <D:/....../raw_data>.
</span></font><font size="2" face="Arial"><span class="492162711-03122013">To run the script in the GRASS command console I use</span></font></div>
<div><font size="2" face="Arial"><span class="492162711-03122013"></span></font> </div>
<div><font size="2" face="Arial"><span class="492162711-03122013">sh D:/...../raw_data/mystript.sh</span></font></div>
<div><font size="2" face="Arial"><span class="492162711-03122013"></span></font> </div>
<div><font size="2" face="Arial"><span class="492162711-03122013">This does not work, and I see that its because the data files can't be found.  So using DIR in the GRASS command console reveals that the search path is C:\PROGRA~1\QGISDU~1\bin</span></font></div>
<div><font size="2" face="Arial"><span class="492162711-03122013"></span></font> </div>
<div><font size="2" face="Arial"><span class="492162711-03122013">In the GRASS command console I then type cd D:/....../raw_data, with no errors.  However, typing DIR or LS in the command line shows that I'm still in C:\...\bin</span></font></div>
<div><font size="2" face="Arial"><span class="492162711-03122013"></span></font> </div>
<div><font size="2" face="Arial"><span class="492162711-03122013">I can make this work by simply copying the data files to the C:\...\bin directory, but its not ideal as the processed files (the ${file}_prep.tif bit) end up in the C:\ directory.  I can also
 modify the <for> loop by adding the full file path, but as you can see, that breaks the script at the r.in.gdal line because r.in.gdal then tries to create a db in my Mapset that has a huge directory path in the name ($file), which is not allowed. 
</span></font></div>
<div><font size="2" face="Arial"><span class="492162711-03122013"></span></font> </div>
<div><font size="2" face="Arial"><span class="492162711-03122013">I think there are other issues, for example when I run the script using the C:/ as above, it adds the db to my Mapset (I can see it with r.info), but I then can't seem to add them as layers. 
</span></font></div>
<div><font size="2" face="Arial"><span class="492162711-03122013"></span></font> </div>
<div><font size="2" face="Arial"><span class="492162711-03122013">Very long winded, but the I think the basic problem is that I can't change the path.  Launching GRASS as administrator does not help.   Ultimately, I'd like to process the raw modis files, add
 them to my mapset, and view the layer.  Working through the rest of the example in 
<a href="http://grasswiki.osgeo.org/wiki/MODIS#MODIS_Aqua">http://grasswiki.osgeo.org/wiki/MODIS#MODIS_Aqua</a> also falls over when I get to the Set Colours section with <palette_sst.gcolors> also because I think the path is not correct.  </span></font></div>
<div><font size="2" face="Arial"><span class="492162711-03122013"></span></font> </div>
<div><font size="2" face="Arial"><span class="492162711-03122013">Thanks for your help!</span></font></div>
<div><font size="2" face="Arial"><span class="492162711-03122013"> </div>
<div><font face="Arial"><font size="2"><font size="2" face="Arial"><span class="492162711-03122013"></span></font></font></font></div>
</span></font>
<div><font size="2" face="Arial"><span class="492162711-03122013">Paul</span></font></div>
<br clear="both">
______________________________________________________________________<BR>
This email has been scanned by the Symantec Email Security.cloud service.<BR>
For more information please visit http://www.symanteccloud.com<BR>
______________________________________________________________________<BR>
</body>
</html>