#!/bin/sh # convert a stdin-doc file to stdout-txt # use antiword from antiword package tmpfile=$(tempfile --suffix=.doc) || exit 1 trap "rm -f -- '$tmpfile'" EXIT cat >>$tmpfile antiword -i1 "$tmpfile" || exit 1 rm -f -- "$tmpfile" trap - EXIT exit 0