Take II at unbreaking world
[dragonfly.git] / share / examples / printing / psif
blob1a816f64888bd80e51ebcbcf16f536c9ea0af14c
1 #!/bin/sh
3 # psif - Print PostScript or plain text on a PostScript printer
4 # Script version; NOT the version that comes with lprps
5 # Installed in /usr/local/libexec/psif
8 read first_line
9 first_two_chars=`expr "$first_line" : '\(..\)'`
11 if [ "$first_two_chars" = "%!" ]; then
13 # PostScript job, print it.
15 echo "$first_line" && cat && printf "\004" && exit 0
16 exit 2
17 else
19 # Plain text, convert it, then print it.
21 ( echo "$first_line"; cat ) | /usr/local/bin/textps && printf "\004" && exit 0
22 exit 2