#! /bin/bash # # Copyright 2002 Double Precision, Inc. See COPYING for # distribution information. # . ${prefix}/share/faxmail/init /usr/bin/perl -e ' foreach ("FROM", "TO", "SUBJECT", "DATE") { $ENV{$_} =~ s/\\/\\\\/g; $ENV{$_} =~ s/\s/ /g; } open(F, "/etc/faxcoverpage.tr") || die "/etc/coverpage.tr: $!\n"; $blank=1; while (defined($_=)) { next if /^#/; next if /^\n/ && $blank; $blank=0; s/%FROM%/$ENV{"FROM"}/ge; s/%TO%/$ENV{"TO"}/ge; s/%SUBJECT%/$ENV{"SUBJECT"}/ge; s/%DATE%/$ENV{"DATE"}/ge; s/%PAGES%/$ENV{"PAGES"}/ge; print; } close(F); print ".nf\n"; while (defined($_=)) { chomp; s/\\/\\\\/g; s/^/\\\&/g; print "\\f(CW$_\\fP\n"; } print ".fi" ' > $OUTDIR/.tr $TBL <$OUTDIR/.tr >$OUTDIR/.tbl rm -f $OUTDIR/.tr $TROFF -mm <$OUTDIR/.tbl >$OUTDIR/.troff rm -f $OUTDIR/.tbl $DPOST <$OUTDIR/.troff >$OUTDIR/.dpost rm -f $OUTDIR/.troff $GS -sDEVICE=faxg3 $FAXRES -dBATCH -sOutputFile=$OUTDIR/f%04d -dNOPAUSE -q -dSAFER - <$OUTDIR/.dpost