ITEM: BM9042L

How to generate large banner on line printer header page?


ENV:
AIX 4.1.4
7013-R30

DESC:
We have several line printers and we want to setup print queues that
create a banner page at the beginning of each job with the user's
name in large block letters.  How can this be done?

ACT:
This can be done either with a C program or a ksh filter

The C program:

/*
        bigbanner is used to generate a large banner page with contains
        the user's name at the beginning of the print job.

        This file is bigbanner.c
        Compile this program with: cc bigbanner.c -o /usr/bin/bigbanner

        To insert into the print queue:

        lsvirprt
           Select the queue
                f=c
                fc=/usr/bin/bigbanner
*/

\#include \

int main()
{        int ch;
        char command[32];

        sprintf(command,"/usr/bin/banner %s", getenv("USER"));
        system(command);
        printf("\\f");           /* Do a form feed */

        while (EOF != (ch = fgetc(stdin)))       /* Read char from stdin */
                fputc(ch,stdout);                /* then print it */
}With a ksh script:

lsvirprt
  Select the queue
     f=c
     fc=/usr/bin/bigbanner

where /usr/bin/bigbanner is the script below:

\#!/bin/ksh
/usr/bin/banner $USER
printf "\\f"
cat


Support Line: How to generate large banner on line printer header page? ITEM: BM9042L
Dated: August 1996 Category: N/A
This HTML file was generated 99/06/24~13:30:21
Comments or suggestions? Contact us