#!/bin/sh
# use .B for bold on
#     .b for bold off
#     .U for underline on
#     .u for underline off
PRINTER="`cat /etc/PRINTER`"
echo $PRINTER
if [ "$PRINTER" = "epson" -o "$PRINTER" = "epsonc" ]; then
# printer codes for epson printers
cat $1 | sed -e s/$/
/ | \
sed -e 's/\.B/E/' | sed -e 's/\.b/F/' | \
sed -e 's/\.U/4/' | sed -e 's/\.u/5/'  | lpr
else
# currently configured for HP Laserjet 4L - PCL
cat $1 | sed -e s/$/
/ | \
sed -e 's/\.B/(s4B/' | sed -e 's/\.b/(s0B/' | \
sed -e 's/\.U/\&d0D/' | sed -e 's/\.u/\&d@/'  | lpr
fi
