<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Hi Chansup,<br>
    <br>
    os.execute just returns the EXIT code of the command.<br>
    <br>
    You will need to do a little more, to catch the output of your
    program, e.g.<br>
    <br>
    function shellExecute(cmd, Output)<br>
       if (Output == nil) then Output = true end<br>
       local file = assert(io.popen(cmd, 'r'))<br>
       if (Output == true) then<br>
          local cOutput = <a class="moz-txt-link-freetext" href="file:read('*all')">file:read('*all')</a><br>
          <a class="moz-txt-link-freetext" href="file:close()">file:close()</a><br>
          return cOutput<br>
       else<br>
          <a class="moz-txt-link-freetext" href="file:close()">file:close()</a><br>
          return<br>
       end<br>
    end<br>
    <br>
    <br>
    Sorry for the delay, I`m on easter holidays and did not follow the
    list.<br>
    <br>
    Best<br>
    Marcus<br>
    <br>
    <div class="moz-cite-prefix">Am 03.04.2020 um 14:56 schrieb CB:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAOAHkMgmU2HDf=SrAag2WawYSLqKqLLPVquuw0pbj1OUV1sn1Q@mail.gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi Marcus,
        <div><br>
        </div>
        <div>the essence of the code looks like</div>
        <div><br>
        </div>
        <div>in job_submitl.lua script, it execute an external script</div>
        <div><br>
        </div>
        <div>os.execute("/etc/slutm/test.sh".." "..job_desc.partition)</div>
        <div><br>
        </div>
        <div>and the external test.sh executes the following command to
          get the partition summary for further processing.</div>
        <div><br>
        </div>
        <div>sinfo -h -p $1 -s<br>
          <div><br>
          </div>
        </div>
        <div>But, this sinfo command returned no result.</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Chansup</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Fri, Apr 3, 2020 at 1:28 AM
          Marcus Wagner <<a href="mailto:wagner@itc.rwth-aachen.de"
            moz-do-not-send="true">wagner@itc.rwth-aachen.de</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">Hi
          Chansup,<br>
          <br>
          could you provde a code snippet?<br>
          <br>
          Best<br>
          Marcus<br>
          <br>
          Am 02.04.2020 um 19:43 schrieb CB:<br>
          > Hi,<br>
          > <br>
          > I'm running Slurm 19.05.<br>
          > <br>
          > I'm trying to execute some Slurm commands from the Lua
          job_submit script <br>
          > for a certain condition.<br>
          > But, I found that it's not executed and return nothing.<br>
          > For example, I tried to execute a "sinfo" command from an
          external shell <br>
          > script but it didn't work.<br>
          > <br>
          > Does Slurm prohibit to execute any Slurm command from the
          Lua job_submit <br>
          > command?<br>
          > <br>
          > Thanks,<br>
          > - Chansup<br>
          <br>
          <br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>