Module 7 banner (SV)

Previous Table of Contents Next


Module 7
banner (SV)

DESCRIPTION

The external banner command displays large letters on your terminal. Since it writes to the standard output you can redirect the output to a file or another command via a pipe. The banner command expands its arguments to your screen as large characters. Only ten characters can be printed on each line. Only three lines are displayed on your screen at one time.

COMMAND FORMAT

Following is the general format of the banner command.

 banner strings 

Arguments

The arguments to banner are strings of ASCII characters. Each string can be up to 10 characters long. Multiple strings may be listed. Each string is displayed on a line by itself. To display more than one string on a line, enclose the strings in double quotes (string1 string2) to form one argument word.

FURTHER DISCUSSION

You may wonder why a command like banner is provided. It seems more fun than work oriented. Maybe so, but it does have some utility value. It can be used to send messages to other users or print banner pages on printouts. The following example shows it being used to send another user a message.

 cj> banner "Wake Up" > tmp      cj> write nancy < tmp      cj> rm tmp 

Nancy s screen would look something like the following display:

 Message from mylogin, tty11...      XX   XX           XXX                       XX  XX      XX   XX            XX                       XX  XX      XX   XX   XXXXX    XX  XX   XXXXX           XX  XX  XX XXX      XX X XX       X    XX XX   XX    X          XX  XX   XX  XX      XXXXXXX  XXXXXX    XXX     XXXXXXX          XX  XX   XX  XX      XXX XXX  X   XX    XX XX   XX               XX  XX   XXXXX      XX   XX  XXXXX X  XXX  XX   XXXXX            XXXX    XX                                                          XXXX 

It s always nice to keep a good friend from getting fired because she was sleeping on the job!

DIAGNOSTICS AND BUGS

Strings that are longer than 10 characters are truncated, displaying only the first 10 characters.

RELATED COMMANDS

Refer to Module 38 on echo .

RELATED FILES

The banner command writes to the standard output. It only reads input from its command line arguments.

APPLICATIONS

The banner command is usually used to print large signs or letters to a printer or display them on a terminal. If is often used to produce a banner page on printouts sent to printers by the lp command. It is sometimes used to display the startup screen of a menu driven shell.

TYPICAL OPERATION

In this activity you use the banner command to display a simple message and then the time of day. Begin at the shell prompt.

1.    Type banner This is a banner message! and press Return . The message immediately begins to display on your screen. Because this message is expanded into five large lines, the first few words scroll off your screen.
2.    Type banner Same Line and press Return . Notice both words are displayed on the same line. If you use quotes around your strings, banner attempts to display all information on the same line.
3.    Type banner ˜date +%H:%M ˜ and press Return . Your screen should look something like the following display.
 cj> banner 


Illustrated UNIX System V
Illustrated Unix System V/Bsd
ISBN: 1556221878
EAN: 2147483647
Year: N/A
Pages: 144
Authors: Robert Felps

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net