Ticket #324: SaveAsHTML.sh

File SaveAsHTML.sh, 579 bytes (added by Frank J Bruzzaniti, 15 years ago)

Bash script to run open office macro

Line 
1#!/bin/sh
2
3# Document and document path variables
4DIR=$(pwd)
5DOC=$DIR/$1
6
7# Quietly kill any copies of soffice still hanging around
8killall -q soffice.bin
9
10# Run macro
11soffice -invisible -norecover -headless "macro:///Standard.Module1.SaveAsHTML($DOC)"
12
13# Construct name variable matching newly created file
14TEMPFILE=`echo $DOC | cut -d'.' -f1`.html
15
16# Since soffice sometimes exits early, sleep until temp HTML file is created
17while [ ! -e $TEMPFILE ]; do
18sleep 1
19done
20
21# Output HTML
22cat *.html
23
24