3 # ifhp - Print Ghostscript-simulated PostScript on a DesJet 500
4 # Installed in /usr/local/libexec/hpif
9 printf "\033&k2G" ||
exit 2
12 # Read first two characters of the file
15 first_two_chars
=`expr "$first_line" : '\(..\)'`
17 if [ "$first_two_chars" = "%!" ]; then
19 # It is PostScript; use Ghostscript to scan-convert and print it
21 /usr
/local
/bin
/gs
-dSAFER -dNOPAUSE -q -sDEVICE=djet500
-sOutputFile=- - \
26 # Plain text or HP/PCL, so just print it directly; print a form
27 # at the end to eject the last page.
29 echo "$first_line" && cat && printf "\f" && exit 0