Forum OpenACS Q&A: Re: Can't exec a command in tcl page

Posted by Neophytos Demetriou on
FWIW, the following works for me - I've tried it from nscp but should work just as well from elsewhere / a TCL page:

set cmd "/usr/bin/libreoffice --headless --convert-to xls /tmp/test2.csv --outdir /tmp"

set handle [ns_proxy get exec_proxy]
set result ""
if { [catch { set result [$handle "exec {*}${cmd}"] } errmsg] } {
      ns_log notice "proxy exec: errmsg=$errmsg"
ns_proxy release $handle

Posted by Antonio Pisano on
I've tried your snippet, but the problem persists: logs report the usual error and the xls is not created.

Would you mind, at your convenience, to issue the command into a ds/shell or a minimal tcl webpage?