Banner (Unix)
The banner program on Unix and Unix-like operating systems outputs a large ASCII art version of the text that is supplied to it as its program arguments. One use of the command is to create highly visible separator pages for print jobs.[1] OperationEach argument is truncated at 10 characters and printed on a "line" of its own. To print multiple words on a single line, they must therefore be passed as a single argument, which is done from the shell by escaping or quoting the words as appropriate.[1] A related and more flexible program is FIGlet, which can display text in different fonts and orientations.[2] ImplementationThe way that the program is implemented internally is antiquated. The character fonts used are hardwired into the program code itself, as statically initialized data structures. Two data structures are used. The first is a data table comprising a sequence of printing instructions that encode the bitmap for each character (in an encoding specific to the Both data structures were hand-written. Spinellis observes that it is "difficult to come up with a more error-prone and unmaintainable data format". He observes a stark contrast between the source code of the Spinellis further observes that in modern computer systems it is seldom sensible to embed such data into the program executable image itself, the performance gains of doing so being negligible. Doing so makes it difficult to adapt the program to different locales, or to maintain the program. The more preferred approach in modern systems is to store such data in a separate data file, distinct from the program executable image file, or in a resource fork of the program, that the program reads at run-time.[3] VersionsA partial list of versions:
Example outputFrom the terminal-oriented banner program: $ banner 'Hello!'
# # ###
# # ###### # # #### ###
# # # # # # # ###
####### ##### # # # # #
# # # # # # #
# # # # # # # ###
# # ###### ###### ###### #### ###
One letter from the printer-oriented banner program as usually found in BSD and derivatives: $ banner -w80 "a"
#####
#########
############### ###
################ ######
################## ########
##### ##### #########
#### #### ## ###
### #### ##
### ### ##
### ### ###
#### ### ####
#############################
##############################
##############################
############################
###########################
###
#
#
Display a continuous clock for approximately 1000 seconds:[a][b] $ repeat 1000 sh -c '( clear ; date +" %H.%M.%S" | xargs banner ; sleep 1)'
# ##### # ##### ####### #######
## # # ## # # # #
# # # # # # # #
# ###### # ##### ###### ######
# # # ### # # ### # #
# # # ### # # ### # # # #
##### ##### ### ##### ####### ### ##### #####
See alsoNotes
References
Further reading
External links |
Portal di Ensiklopedia Dunia