<div dir="ltr">Hi Federico,<div><br></div><div>I found a workaround solution (trial and error) that is not documented:</div><div><br></div><div>[out,TF]=dos("start | grdinfo Test_10-FAA.grd"); out, TF - A solution using piping. Perhaps someone can explain further, but it looks like 'start' initiates the command window and then the commands on the right of the pipe symbol are fed through the cmd , although normally it goes the other way round?<br></div><div><br></div><div>This gives the result expected and also pipes to the console:</div><div><br></div><div>[out,TF]=dos("start | grdinfo Test_10-FAA.grd"); out, TF<br> out  = <br><br>  "Test_10-FAA.grd: Title: "                                           <br>  "Test_10-FAA.grd: Command: grdsample -R-10/10/-10/10 -I1m @GMTAPI@-000001 -Gc:\Temp\Test_10-FAA.grd -fg --GMT_HISTORY=false"<br><br>  "Test_10-FAA.grd: Remark: "                                          <br>  "Test_10-FAA.grd: Pixel node registration used [Geographic grid]"    <br>  "Test_10-FAA.grd: Grid file format: nf = GMT netCDF format (32-bit float), CF-1.7"<br><br>  "Test_10-FAA.grd: x_min: -10 x_max: 10 x_inc: 0.0166666666667 (1 min) name: longitude n_columns: 1200"<br><br>  "Test_10-FAA.grd: y_min: -10 y_max: 10 y_inc: 0.0166666666667 (1 min) name: latitude n_rows: 1200"<br><br>  "Test_10-FAA.grd: v_min: -104.96169281 v_max: 456.651062012 name: z" <br>  "Test_10-FAA.grd: scale_factor: 1 add_offset: 0"                     <br>  "Test_10-FAA.grd: format: netCDF-4 chunk_size: 134,134 shuffle: on deflation_level: 3"<br> TF  = <br><br>  T<br></div><div><br></div><div>I am pretty sure we never had to do this in earlier 5.x versions?</div><div><br></div><div>So not sure if the documentation needs more clarity or there are missing/extra parameters to consider.</div><div><br></div><div>Lester</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 28 Jul 2021 at 16:31, Federico Miyara <<a href="mailto:fmiyara@fceia.unr.edu.ar">fmiyara@fceia.unr.edu.ar</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <br>
    <font face="Courier New">Lester,<br>
      <br>
      I don't know whether your post is related to my earlier message or
      it is just that we both have had the same problem.<br>
      <br>
      Unfortunately the documentation isn't clear enough, for instance
      it says:<br>
      <br>
        commands  <br>
        Single text containing instructions sent to the MS Windows
      cmd.exe command interpreter.<br>
      <br>
      but it doesn't say how the instructions should be connected. They
      could be separated by commas, by spaces, by semicolons...
      Seemingly it is by spaces (at least this way the bOK argumet is
      True), but there could be some ambiguity, for instance if one
      wants to change directory and the directory contains two words and
      the second is also a command or a program.<br>
      <br>
      On the other hand the expression "single text" is not clear. What
      is a "text" in Scilab? Text is meaningless, in Scilab we have
      strings, and "single" is somewhat vague. Does it mean a
      one-component string?<br>
      <br>
      Your workaround of using a batch may work, but it requires the
      extra job of creating and saving it and at the end deleting it,
      which should be automatic.<br>
      <br>
      Regards,<br>
      <br>
      Federico Miyara<br>
      <br>
    </font><br>
    <div>On 28/07/2021 10:57, Lester Anderson
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Hello all,<br>
        <br>
        This has been queried previously without an obvious solution.<br>
        <br>
        For example: [output, bOK]=dos('grdinfo Test_10-FAA.grd')<br>
        Fails with bOK = F<br>
        <br>
        Adding 'start grdinfo Test_10-FAA.grd gives bOK=T but now dos
        window console with the result<br>
        <br>
        The only way to get the out put shown below is to put the
        commands into a bathch  file:<br>
        grd-info.bat (containing the command stream grdinfo
        Test_10-FAA.grd<br>
        <br>
        Such that the dos function becomes: [out,TF]=dos('start
        grd-info.bat'); out, TF<br>
        <br>
        \D_Drive\Geoscience\Scilab>grdinfo Test_10-FAA.grd<br>
        Test_10-FAA.grd: Title:<br>
        Test_10-FAA.grd: Command: grdsample -R-10/10/-10/10 -I1m
        @GMTAPI@-000001 -Gc:\Temp\Test_10-FAA.grd -fg
        --GMT_HISTORY=false<br>
        Test_10-FAA.grd: Remark:<br>
        Test_10-FAA.grd: Pixel node registration used [Geographic grid]<br>
        Test_10-FAA.grd: Grid file format: nf = GMT netCDF format
        (32-bit float), CF-1.7<br>
        Test_10-FAA.grd: x_min: -10 x_max: 10 x_inc: 0.0166666666667 (1
        min) name: longitude n_columns: 1200<br>
        Test_10-FAA.grd: y_min: -10 y_max: 10 y_inc: 0.0166666666667 (1
        min) name: latitude n_rows: 1200<br>
        Test_10-FAA.grd: v_min: -104.96169281 v_max: 456.651062012 name:
        z<br>
        Test_10-FAA.grd: scale_factor: 1 add_offset: 0<br>
        Test_10-FAA.grd: format: netCDF-4 chunk_size: 134,134 shuffle:
        on deflation_level: 3<br>
        <br>
        However, even with this workaround, nothing is written to the
        variable 'out'. The program 'grdinfo' is in the Windows path, so
        should be run without using start. In the past, the function did
        work. Basic Windows commands like {out, TF]=dos('dir') works.<br>
        <br>
        I have verified that nothing is written to the consolebox. In
        addition, this is a new computer and new install of Scilab 6.1.1<br>
        Also, the same function under Octave runs correctly as
        dos('grdinfo Test_10-FAA.grd'), and I am assuming the Scilab
        version should behave the same.<br>
        <br>
        Since the mailinglists section is no longer functional, I cannot
        check for possible solutions or pointers. Apologies if this is
        repeating my previous query on the issue.<br>
        <br>
        Thanks<br>
        <br>
        Lester<br>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
users mailing list
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  <div id="gmail-m_-4480437246932235519DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <table style="border-top:1px solid rgb(211,212,222)">
        <tbody><tr>
      <td style="width:55px;padding-top:18px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
                <td style="width:470px;padding-top:17px;color:rgb(65,66,78);font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Libre de virus. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" style="color:rgb(68,83,234)" target="_blank">www.avast.com</a>              </td>
        </tr>
</tbody></table>
<a href="#m_-4480437246932235519_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></div>

_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote></div>