APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

What is a virtual printer? (SCO Unix/System V )

Note: this article is for Sys V printing, not CUPS. However, by using System V interface scripts within CUPS, you can do all of this.

You can have a printer that sends its output to another printer; pipe the final output to lp -s -dotherprinter You'll probably want the first printer's device to be /dev/null, but consider that it does not have to be: you can have a printer that prints to multiple places at the same time.

This scheme can be very useful for network printers that use lpd. Rather than trying to pass options through, front end with a script that does whatever needs to be done (like running it through /usr/lib/lponlcr) and then passes it to the lpd printer.

This is how you do "virtual" printers: many names all going to the same print device, but all with diferent options. This is often easier than handling all the testing for different switches inside one interface, and it gives you mnemonic names like "HPLandscape", "HPLetterTray", etc.

The simplest model for that is to create your own script:

shift; shift; shift; shift; shift
cat $* | lp -s -d otherprinter

Another way is to use the "network" script. Let's say you want to actually send to "kyocera":

 cp /usr/spool/lp/model/network /usr/spool/lp/model/yourscript
 vi /usr/spool/lp/model/yourscript
 (add whatever you need and then)
 /usr/lib/lpadmin -p wrapit -m yourscript -v /dev/null
 /usr/lib/accept wrapit
 enable wrapit
 echo "wrapit: lp -dkyocera" >> /usr/spool/lp/remote

You also need to remove the lines near the top of the script that say:

[ -r $mapping ] || exit 2
set -- `grep -e "^$printer:" $mapping` || exit 3

Now when you print to "wrapit", it will go to the kyocera carrying whatever you added in the script.

If you have 5.0.6 or newer Roberto Zini offers:

Early this year I made some tests and they actually worked; as an example:

. create the /tmp/myfilter.sh script

. this script is made of the following lines:


. give this script 755 permissions

. modify your /etc/printcap file and add, on the line which refers to 
the remote printer, the "of=/tmp/myfilter.sh" statement

. run the Printer Manager and restart both local & remote print services

. now print by using "lp -d<your_printer> filename

You should end up having the hex dump of the <filename> printed on the 
remote printer.

Please notice that I customer of ours was unable to get the same results 
until he removed and reinstalled a just-downloaded copy of RS506A.

See also Using Netcat for a simple lpr client by Carsten Hammer

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> (SCO Unix) What is a virtual printer?


Click here to add your comments
- no registration needed!

Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments

If you want a picture to show with your comment, go get a Gravatar
Kerio Samepage

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Jump to Comments

Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

I am a Kerio reseller. Articles here related to Kerio products reflect my honest opinion, but I do have an obvious interest in selling those products also.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

This post tagged: