187866Ssheldonh#!/bin/sh 287866Ssheldonh 387866Ssheldonh# Sample input filter to print on HP Laser Jet printers 487866Ssheldonh# Installed in /usr/local/libexec/hp6l 587866Ssheldonh 687866SsheldonhDEVICE="ljet3" 787866SsheldonhPAPERSIZE="a4" 887866Ssheldonh 987866Ssheldonhprintf "\033&k2G" || exit 2 1087866Ssheldonh 1187866Ssheldonhread first_line 1287866Ssheldonhfirst_two_chars=`expr "$first_line" : '\(..\)'` 1387866Ssheldonh 1487866Ssheldonhif [ "$first_two_chars" = "%!" ]; then 1587866Ssheldonh exec 3>&1 1>&2 1687866Ssheldonh /usr/local/bin/gs -sPAPERSIZE=${PAPERSIZE} -dSAFER -dNOPAUSE -q -sDEVICE=${DEVICE} \ 1787866Ssheldonh -sOutputFile=/dev/fd/3 - && exit 0 1887866Ssheldonhelse 1987866Ssheldonh echo $first_line && cat && printf "\033&l0H" && exit 0 2087866Ssheldonhfi 2187866Ssheldonh 2287866Ssheldonhexit 2 23