121240Swosch#!/bin/sh
221240Swosch#
321240Swosch#  psif - Print PostScript or plain text on a PostScript printer
421240Swosch#  Script version; NOT the version that comes with lprps
521240Swosch#  Installed in /usr/local/libexec/psif
621240Swosch#
721240Swosch
821240Swoschread first_line
921240Swoschfirst_two_chars=`expr "$first_line" : '\(..\)'`
1021240Swosch
1121240Swoschif [ "$first_two_chars" = "%!" ]; then
1221240Swosch   #
1321240Swosch   #  PostScript job, print it.
1421240Swosch   #
1541604Sbillf   echo "$first_line" && cat && printf "\004" && exit 0
1621240Swosch   exit 2
1721240Swoschelse
1821240Swosch   #
1921240Swosch   #  Plain text, convert it, then print it.
2021240Swosch   #
2141604Sbillf   ( echo "$first_line"; cat ) | /usr/local/bin/textps && printf "\004" && exit 0
2221240Swosch   exit 2
2321240Swoschfi
24