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

Collapse
Posted by Antonio Pisano on
The real command is this, took the wrong part of the log.

exec libreoffice --headless --convert-to xls /tmp/fileBXXCcF.xls /tmp/fileBXXCcF.csv

Same error though.

Collapse
Posted by Dave Bauer on
Does the operation complete successfully?

We had this problem with many commands, where the output of the command causes Tcl exec to think the command has failed when it was fine.

We catch the exec and look for specific error responses in the output as necessary.

Many sites I have worked on used a modified exec replacement that took care of the catch automatically.

Collapse
Posted by Gustaf Neumann on
A common cause is that the executed script outputs to stderr. This leads per-default to the same failure like a non-zero return code. I would recommend to redirect stderr to stdout (adding the the script 2>@1)

A longer discussion is e.g. here: http://wiki.tcl.tk/1039