Jim Foltz wrote:
> 
> On Tue, Sep 29, 1998 at 04:41:06PM +0000, Kent West wrote:
> > Maybe I just don't understand how printcap/lpc/filters work (very
> > likely).
> >
> > I've got a printcap entry like this:
> >
> > beeper:\
> >       :if=/etc/magicfilter/beeper-filter:\
> >       :lp=/dev/null:\
> >       :sd=/var/spool/lpd/beeper:\
> >
> > I've got a filter named beeper-filter that looks like this:
> > #!/usr/bin/perl
> > print "\ntest\n\n";
> 
> Try to use a shell script just to see if the filter is executing.
> Try this:
> 
> #!/bin/sh
> echo "Test" > /tmp/testfile
> 
> You may need to set the executable bit on the filter with chmod.
> 
> >
> > When I do a test print, such as
> > ls -l | lpr -Pbeeper
> >
> > nothing happens that I can tell. The word "test" never shows up
> > anywhere.
> >
> > Can anyone tell me what I'm doing wrong?
> --
> Jim Foltz <[EMAIL PROTECTED]>


Thanks Jim, but this didn't work. My beeper-filter file looks like this:

#!/usr/bin/perl
echo "test" > /tmp/testfile;

The permissions on the beeper-filter file are -rwxr-xr-x

My printcap looks as listed above. 

It's like the input filter is never being called. If I set the printcap
entry so it remote prints to our network printer, like so:
beeper:\
        :if=/etc/magicfilter/beeper-filter:\
        :lp=:\
        :sd=/var/spool/lpd/beeper:\
        :rm=(the ip address):\
        :rp=nimrod_2:

I can do a "ls -l | lpr -Pbeeper" and get some output. I get a banner
page (I'm not sure what Linux banners look like, so I'll mention that
it's just 4 lines in top left of page with username, host, class, and
job), and I get one page that has "totla 4131" and the ls -l output of a
single file (out of many that should be there). I tried adding "cat" to
the end of my beeper-filter file but that didnt' make a difference.
However, I'm not too concerned with the printer output right now (I
figure it's because it's a Laserjet, not an ascii printer).

This is all just minimal testing to see if I can do what I want to do.
What I really want to do is reroute a print job to an email message as
well as to the printer. I'd take any help I can get on this. The
suggestions I've had have been along these lines, but so far, I haven't
been able to get it to work.

Thanks!

Kent

Reply via email to