#!/bin/bash
# This is a silly example of a filter. In reality you probably wouldn't want
# lpd to hold up your print queue while this was doing it's thing. On the other
# hand it takes so long to print texinfo on my Epson FX-80 that this delay
# is not significant.
/bin/mkdir /tmp/${0##*/}.$$
cd /tmp/${0##*/}.$$
/bin/cat >stdin.texi
{ 
  /usr/TeX/bin/tex stdin.texi
  /usr/TeX/bin/texindex stdin.??
  /usr/TeX/bin/tex stdin.texi
} >/dev/null
/bin/mv stdin.dvi dvifile
/bin/rm stdin.*
cd -
${0%/*}/dvi2epson </tmp/${0##*/}.$$/dvifile
/bin/rm -rf /tmp/${0##*/}.$$
