#! /bin/sh # # in order to use cnprint as a filter, you need to save this file as # /var/spool/lpd/cnprint-script and setup your /etc/printcap following # step 1. # # 1. In my printcap file, I setup a "printer" called "gencnp" using # the following (delete the #s and make changes before use in # your printcap): # # Experimental printer on "gen" using CNPRINT as a filter #gencnp|lpcnp:\ # :lp=/dev/null:\ # :sh:\ # :mx#0:\ # :lf=/var/adm/lpd-errs:\ # :sd=/var/spool/lpd/gencnp:\ # :if=/var/spool/lpd/cnprint-script: # # 2. Printing to "gencnp" evokes "cnprint" using this script, which # in turn accepts input, converts to PS file, and evokes the # "gen" printer. As a result, there is no output to stdout. # Thus, it is likely to confuse the printer queue. # /usr/local/bin/cnprint -io | lpr -Pgen -U$5 # # Note: # 1. You must use absolute path for "cnprint", otherwise the script # may not be able to find "cnprint" command. Change it to what # is on your system. # 2. You may use other options except the -io option for "cnprint". # 3. "gen" is the name of the printer I use, change it. # 4. -U$5 option gets the user name, usually you should not use it. # However, if your system needs this information, you should change # the number 5 to some other number until you correctly get the # user name. # 5. I named this file as "cnprint-script" and put it under # "/var/spool/lpd", you should do similar things. #