• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How do I create a 'dummy' printer?

exeter

Member

Thanks: 2
Messages: 22

#1
I'm having trouble with a program I'm working on, which generates spurious printouts. I'd like to create a new entry in /etc/printcap to send the this unwanted output to. What's the best way to do that? Thanks.
 

shepper

Aspiring Daemon

Thanks: 194
Messages: 612

#2
There are a couple of ways.

One would be
Code:
:if=/dev/null:\
Your wayward program would send the printout but it would die at /dev/null.

If you need to look at the output, you could set a second print queue. Section 9 in the handbook describes setting up multiple queues. Combine this with a smart filter -> postscript with print/a2ps or print/enscript-letter

Another option is to use lpc(8) to turn off the printer daemon.
 

exeter

Member

Thanks: 2
Messages: 22

#3
Thanks for that helpful post. I added this line to /etc/printcap
Code:
dummy:if=/dev/null
Now the line
Code:
$ lpr -Pdummy filename
prints NOTHING AT ALL - HURRAH!