<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 5, 2015 at 10:51 PM, David Carlisle <span dir="ltr"><<a href="mailto:d.p.carlisle@gmail.com" target="_blank">d.p.carlisle@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 5 December 2015 at 21:17, luigi scarso <<a href="mailto:luigi.scarso@gmail.com">luigi.scarso@gmail.com</a>> wrote:<br>
><br>
><br>
> On Sat, Dec 5, 2015 at 6:51 PM, David Carlisle <<a href="mailto:d.p.carlisle@gmail.com">d.p.carlisle@gmail.com</a>><br>
> wrote:<br>
<br>
><br>
</span><span class="">> try<br>
><br>
> \directlua{print('os.execute():|',os.execute(),'|')}<br>
> \bye<br>
><br>
> with  also<br>
> --shell-restricted<br>
> --no-shell-escape<br>
><br>
> It should be ok.<br>
><br>
><br>
><br>
> --<br>
> luigi<br>
<br>
<br>
</span>Oh thanks!<br>
<br>
Hmm so os.execute with empty argument doesn't call the shell and just<br>
returns 0,1 or 2?<br>
<br>
I have to ask, could I have deduced that from the manual?;-)<br></blockquote><div><br></div><div><br></div><div><br></div><div>The current code is <br></div><div><br></div><div>static int os_execute(lua_State * L)<br></div></div><div class="gmail_extra">{</div><div class="gmail_extra">    int allow = 0;</div><div class="gmail_extra">    int ret = 1;</div><div class="gmail_extra">    char *safecmd = NULL;</div><div class="gmail_extra">    char *cmdname = NULL;</div><div class="gmail_extra">    const char *cmd = luaL_optstring(L, 1, NULL);</div><div class="gmail_extra"><br></div><div class="gmail_extra">    if (cmd == NULL) { /* pretend we are \.{\\pdfshellescape} */</div><div class="gmail_extra">        if (shellenabledp <= 0) {</div><div class="gmail_extra">            lua_pushinteger(L, 0);</div><div class="gmail_extra">        } else if (restrictedshell == 0) {</div><div class="gmail_extra">            lua_pushinteger(L, 1);</div><div class="gmail_extra">        } else {</div><div class="gmail_extra">            lua_pushinteger(L, 2);</div><div class="gmail_extra">        }</div><div class="gmail_extra">        return 1;</div><div class="gmail_extra">    }</div><div><br></div>:</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">but I'm not sure that this will be the final form --- maybe for this reason it  is still to be documented.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">-- <br><div class="gmail_signature">luigi<br></div>
</div></div>