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

SCO Unix/System V Printing FAQ


Some material is very old and may be incorrect today

© December 2003 (various)

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 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.

How do I stop banners from printing? (SCO Unix/System V )

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 Unix SysV Printing

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"


If you found something useful today, please consider a small donation.



Got something to add? Send me email.





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

Printer Friendly Version

->
-> (SCO Unix) How do I stop banners from printing?


Inexpensive and informative Apple related e-books:

iOS 10: A Take Control Crash Course

Photos for Mac: A Take Control Crash Course

Take Control of Preview

Take Control of the Mac Command Line with Terminal, Second Edition

Take Control of iCloud, Fifth Edition








Printer Friendly Version

Have you tried Searching this site?

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


Printer Friendly Version





Technology is both a tool for helping humans and for destroying them. This is the paradox of our times which we're compelled to face (Frank Herbert).




Linux posts

Troubleshooting posts


This post tagged:

FAQ

Printing

SCO_OSR5



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode