SUMMARY: Re: how do I get my own printcap filter to work?

From: Eric LaPresto (
Date: Wed Dec 15 1993 - 06:47:36 CST

In article <> (Eric LaPresto) writes:
>I have an application that prints out in PostScript format, but
>it's first character is always a ^D. This invariably screws up my
>Postscript printer, which proceeds to print out pages and pages of
>Postscript code. I've designed a simple sed filter to remove the
>initial ^D without affecting the rest of the Postscript. This I
>know works; I've tested it manually.
> % sed 's/^^D\(.*\)/\1/g' _file_
>I want to use this sed as an input (or output) filter as part of
>my /etc/printcap file. I specified
> :if=/etc/sed.script
>within the printcap entry, with the contents of file /etc/sed.script:
>#!/bin/csh -f
>cat | sed 's/^^D\(.*\)/\1/g'
>exit 0
>File mode is 755, permissions are root.daemon.
>I've found that this input filter file is not working. It seems like
>it is not even being evaluated. Any ideas?
>BTW, I'm using SunOS 4.1.1.
>Eric LaPresto Dept. of Biomedical Engineering
> Cleveland Clinic Foundation
>216-445-9368 Cleveland, OH

Based upon the advice that filters set up for a remote printer will
only be executed on that printer's local machine, and the fact that
I was trying this filter from a remote machine, I set out to develop
a filter for that local machine (also Sun sparc, 4.1.1). I couldn't
use my original sed filter, because this printer is a SPARCprinter
with its own set of input filters (using PreLimm).

I first created a new "file" type in the /etc/magic file:

0 string ^D%! Windows Postscript document

And then in the PreLimm file "pl.sun4/.pl_alias" I defined a new

ps Windows Postscript document

Now when the input filter recognizes the input job as a "Windows
Postscript document", it gets passed through as a Postscript file and
not as an ASCII text file.

Thanks to all those people who offered suggestions!


This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:33 CDT