This article is from a FAQ concerning SCO operating
systems. While some of the information may be applicable to any OS,
or any Unix or Linux OS, it may be specific to SCO Xenix, Open
Desktop or Openserver.
There is lots of Linux, Mac OS X and general Unix info elsewhere on
this site: Search this site is the best
way to find anything.
You need to edit the file /etc/default/lpd. You need one of the following lines:
For Xenix: BANNERS=0
For Unix: BANNERS=nobanner
Note that there are some Unix printer interface scripts which do not use /etc/default/lpd, and you must use an option to these to disable banners. Also, some Unix printer interface scripts expect the Xenix syntax above. Aren't standards wonderful? Should you encounter one of these, if you're reasonably adept at shell scripts, you might want to cut and paste the section that reads /etc/default/lpd from a script that works properly. Of course, be sure you make note of your changes so that you can redo them the next time an upgrade replaces your printer drivers.
On Unix systems, *sometimes* setting it to BANNERS=nobanner was the supposedly correct thing to do, but not usually.
Some printer scripts work from default/lpd even now, but some don't, and that can be annoying.
On Release 5, you are supposed to be able to choose Advanced settings from the Printer Configuration manager, and set the number of banners to 0.
The problem is that some of the interface scripts that SCO provides don't respect or even check the settings in /etc/default/lpd, and although most of the modern ones respect the setting from the Printer Manager, there are no guarantees. Do try the simple ways first. If you have a current version, you should be able to modify this completely within the printer manager. But, if that doesn't work (perhaps because you have third party scripts) you need to modify the scripts themselves.
You'll need to modify the scripts to take away the banners. Unfortunately, there are differences between the scripts, and even after that, there is still more work you'll have to do to make the changes permanent.
To begin with, search in the script for "banner=" at the start of the line. You can do this in vi by typing "/^banner=" and pressing enter. If you find nothing, try "/^nobanner=". If you still find nothing, try "/^BANNER".
Most of the scripts will say :
banners="yes"
On these, you want to change the "yes" to "no". But watch out: some scripts (the HPLaserJet for example) need it to be
banners=""
You need to read more of the script to see if that is the case.
Unfortunately, some scripts say:
nobanners="no"
and on these, of course, you must change "no" to "yes".
A few scripts might have:
BANNERPAGE="yes"
This, of course, requires a change to "no".
Some scripts expect that a variable will be passed to them in the environment. These generally test something like this:
if [ -z "${BANNERS}" ]
then
nhead=1
else
nhead=${BANNERS}
fi
For these, you'd set "nhead=0" after this section of the script. You should also be able to accomplish this from the SCO 5 print manager by setting the BANNERS setting to 0, but editing the script is absolute. Some of the scripts are really dumb about all of this.
It is entirely possible that you may have a script that does not use any such variables, but just blindly prints headers and or trailers. In such cases, you need to find where it's doing the printing and comment out those lines by putting a "#" ahead of them. If you are not sure what to comment out, you might be better off replacing this script with something more user friendly from /usr/spool/lp/model. Be sure to make a safe copy first, though. Having unwanted banners is better than not printing at all.
LPD printers are another story all together. Roberto Zini offers the following:
We had a customer who was lazy enaugh not to specify the
'nobanner' option along with the lp(C) command: for every
print job submitted a banner page got printed too and the
customer was not pretty happy about it (he already tried by
inserting the "BANNERS=nobanner" parameter in /etc/default/lpd
but unsuccesfully.
By following the printcap(SFF) manual pages, he inserted the
'sh' parameter in the line remote printer line: that should
tell lp(C) to add the 'nobanner' option on its command line
but it didn't work. So, to ease his pain, I wrote the following
lp "wrapper" script, which actually did the job:
=== cut here ===
#!/bin/sh
#
# Faked lp(C) frontend to fool the lp(C) subsystem when
# it's unable to process the 'sh' flag in the /etc/printcap file.
#
# This file should be placed under /usr/bin and replaces the
# original lp(C) file which gets renamed as lp.orig; please
# set this script permissions accordingly to the original
# lp(C) ones.
# (chmod 2111 lp)
#
# R.Zini - Strhold (22/03/2000)
#
MLPDEF=`lpstat -d | awk '{ print $4 }'`
MYOPTS="$*"
MYPRT=""
MYBAN=0
MYDEF=""
#
# Grab the '-d <printer>' option; if it's not given, use the
# the DEFAULT destination printer.
#
while getopts :d: a
do
case $a in
d) MYPRT=$OPTARG;;
esac
done
#
# Do we have to use the default printer ?
#
if [ "Z$MYPRT" = "Z" ]
then
MYPRT=$MLPDEF
MYDEF="-d $MYPRT "
fi
#
# Check if we have to give the '-onobanner' option;
# in the /etc/printcap file the administrator has to insert
# the 'sh' flag for this trick to work.
#
grep ":rp=$MYPRT:" /etc/printcap | grep "sh" 1>/dev/null 2>&1 && MYBAN=1
if [ $MYBAN -eq 1 ]
then
exec lp.orig $MYDEF -onobanner $MYOPTS
else
exec lp.orig $MYDEF $MYOPTS
fi
=== cut here ===
It's a "quick & dirty" script and perhaps it should be
rewritten by making use of a more consistent style
(I'm not that good at shell programming) but I've
been told that it suited my customer's needs.
See also /Unixart/printing.html
If your app is sending "-o nobanner", you might get something like this:
ERROR: The following options can't be handled:
-h (or -o nobanner)
UX:lpd: TO FIX: The printer(s) that otherwise qualify
for printing your request can't handle
one or more of these options. Try
another printer, or change the options.
To fix that, do "/usr/lib/lpadmin -p yourprintername -o nobanner"
/SCOFAQ/FAQ_scotec7banners.html copyright 1997-2003 (various) All Rights Reserved
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. We appreciate comments and article submissions.
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.
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.
Click here to add your comments
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