<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Dear César, dear all,</div>

<div> </div>

<div>thanks for your input, but the core problem remains:</div>

<div> </div>

<div>When a Shell-script is invoked from the GRASS-shell (GRASS6.4.2 on Suse Linux on a HPC cluster) with a monitor (x0, PNG, etc.) being already activated (d.mon start / d.mon select), a g.gisenv _within_ the script will properly reference the active monitor ("MONITOR=x0"), BUT a "d.save -c" will throw a "WARNING: No socket to connect to for monitor" while "d.out.file" gives an "ERROR: no monitor selected".</div>

<div> </div>

<div>A feasible workaround would be to store the monitors content with d.save before running the script and recreating the content afterwards, but this is less than elegant. </div>

<div> </div>

<div>Suggestions, anyone ?</div>

<div> </div>

<div>Best,</div>

<div>Peter</div>

<div> </div>

<div> </div>

<div> </div>

<div class="signature"><peter.loewe@gmx.de></div>

<div> 
<div> 
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div name="quoted-content">What I use on scripts is the PNG monitor setting the GRASS_PNGFILE, GRASS_HEIGHT and GRASS_WIDTH before starting the monitor.<br/>
<br/>
Take a look at the PNG Driver manual pages for more variables: <a href="http://grass.osgeo.org/grass64/manuals/pngdriver.html" target="_blank">http://grass.osgeo.org/grass64/manuals/pngdriver.html</a><br/>
 
<div class="gmail_quote">El lun, 10 de noviembre de 2014 17:42, "Peter Löwe" <<a href="peter.loewe@gmx.de" target="_parent">peter.loewe@gmx.de</a>> escribió:

<blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;">Hi all,<br/>
<br/>
I'm trying call up d.out.file from within an add-on Shell-script for GRASS 6.>=4, but keep getting the following error:<br/>
ERROR: No such monitor as <GRASS_MONITOR><br/>
d.out.file output=test20141110 format=geotiff resolution=1 size=1440,720<br/>
ERROR: You must select a display monitor.<br/>
<br/>
Let's assume that a GRASS monitor has been _started_ and _selected_ (x0, PNG, or similar) in the current GRASS session and some rasters and vectors have been drawn on it. Then, the script is invoked which needs to write out the content of the currently active monitor.<br/>
<br/>
Up till now neither a simple "export `g.gisenv`" or an explicit re-selecting the monitor via "d.mon select=$THECURRENTMONITOR" within the script improved the situation.<br/>
<br/>
Hints and suggestions would be greatly appreciated.<br/>
<br/>
 </blockquote>
</div>
</div>
</div>
</div>
</div></div></body></html>