Posting this to the server forum because it involves scripting on a headless server.
I'm trying to get a script that will convert openoffice.org docs (.odt) to text over ssh or via cron job. I found a script that works here:
http://www.togaware.com/linux/surviv...t_MS_Word.html
Baiscally the site provides a macro, which gets invoked thusly:
Code:
#!/bin/sh
DIR=$(pwd)
DOC=$DIR/$1
/usr/bin/oowriter -invisible "macro:///Standard.Module1.ConvertWordToPDF($DOC)"
But that seems to require an X11 display, and as I said, I'll be running this over ssh and via cron so by default there's no X display available.
Here's the error I get when I run the script as described in the tutorial above:
Code:
$ ./doc2txt.sh ~/Documents/resume\ 2008.odt
javaldx: Could not find a Java Runtime Environment!
$ /usr/lib/openoffice/program/soffice.bin X11 error: Can't open display:
Set DISPLAY environment variable, use -display option
or check permissions of your X-Server
(See "man X" resp. "man xhost" for details)
I definitely do have a Java Runtime Environment - openoffice runs fine when logged in locally.
So my question is, how do I tell my script where my JRE is, and how do I pass openoffice to a local display?
Thanks in advance for the help!
P.S. I'm running Ubuntu 8.10.