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

Collapse
Posted by Neophytos Demetriou on
The following seems to do the trick for me (even though I would have preferred to go with what Gustaf says):

    exec -- /bin/sh -c "$cmd || exit 0" 2> /dev/null

Another way is to use ns_proxy as follows:

    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
    return $result

You might want to check OdfConverter for DOCX. I had used it with some success in MediaBox a long time ago. I remember having some issues with headless OpenOffice at the time (circa 2006-2007) and thus I was using the DocumentConvert.py --- it's kind of old but I have uploaded anyway here:

https://openacs.org/storage/?folder_id=2551358