非 PS ネットワークプリンタに出力したい場合
の /etc/printcap は
# /etc/printcap: printer capability database. See printcap(5).
# You can use the filter entries df, tf, cf, gf etc. for
# your own filters. See /etc/filter.ps, /etc/filter.pcl and
# the printcap(5) manual page for further details.
lp|cannon laser printer using network :\
:lp=/dev/null:\
:sd=/var/spool/lpd/lp:\
:lf=/var/spool/lpd/lp/lpr-err:\
:af=/var/log/smb-acct:\
:rm=IP Address or Host name:\
:if=/usr/local/libexec/canon:\
:pl#66:\
:pw#80:\
:pc#150:\
:mx#0:\
:sh:
if で記述される実行ファイルがフィルタ本体.
ここで使用しているフィルタは
#!/bin/sh -
IF=/var/tmp/smbprn-in.$$
OF=/var/tmp/smbprn-out.$$
cat > $IF || exit 2
{ echo showpage; echo quit; } | \
/usr/bin/gs -q -dSAFER -dNOPAUSE -sDEVICE=lips3 -sOutputFile=$OF $IF 2> /dev/null > /dev/null || exit 2
cat $OF || exit 2
rm -f $IF $OF
exit 0