Tput

Tput

Tput is a standard Unix computer operating system command which is used to set terminal features.

Depending on the system, "tput" uses the terminfo or termcap database, as well as looking into the environment for the terminal type.

History

"Tput" was provided in UNIX System V in the early 1980s. A clone of the AT&T "tput" was submitted to volume 7 of the mod.sources newsgroup (later comp.sources.unix) in September 1986. [cite web
url=http://gatekeeper.hpl.hp.com/archive/pub/usenet/comp.sources.unix/volume7/tput.Z
title=Public-domain tput(1) program
first=Badri
last=Lokanathan
date=1986-08-28
accessdate=2008-04-22
] [cite web
url=http://gatekeeper.hpl.hp.com/archive/pub/usenet/comp.sources.unix/volume7/tput2.Z
title=Public-domain TPUT (corrected implementation)
first=Badri
last=Lokanathan
date=1986-09-19
accessdate=2008-04-22
] In contrast to the System V program, the clone used termcap rather than terminfo. It accepted command-line parameters for the cm (cursor addressing) capability, and recognized terminfo capability names.

System V Release 3 provided an improved version which combined the different initialization capabilities as a new option init, and the reset capabilities as reset, thereby simplifying use of "tput" for initializing or reinitializing the terminal. [citation
url=http://books.google.com/books?id=GsUMLqtYI1UC&dq=tput&source=gbs_summary_s&cad=0
title=Termcap and terminfo
last1=Strang
first1=John
last2=Mui
first2=Linda
last3=O'Reilly
first3=Tim
publisher=O'Reilly
date=1988
page= [http://books.google.com/books?id=GsUMLqtYI1UC&pg=PA56&lpg=PA56&dq=tput&source=web&ots=RnDIfpRWXc&sig=XVEfQkgjzMA7HC2wdAJMEC9bUlI&hl=en 56-57]
isbn=0937175226
] System V Release 3.2 added several printer-specific capabilities to the terminfo database, such as swidm (enter_doublewide_mode) which "tput" could use. It also added capabilities for color.

System V Release 4 defined additional terminfo capabilities including standardized ANSI color capabilities setaf and setab, which could be used by "tput".

BSD platforms provided a different implementation of "tput" in 4.3BSD-Reno (June 1990). [cite web
url=http://minnie.tuhs.org/Unix_History/4bsd
title=3BSD/4BSD versions
date=2000-06-25
publisher=The Unix Heritage Society
accessdate=2008-04-20
] It used termcap, recognizing only termcap capability names, and did not accept command-line parameters for cursor-addressing. FreeBSD used this in 1994, improving it by accepting one or two numeric command-line parameters. [cite web
url=http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/tput/tput.c
title=CVS log for src/usr.bin/tput/tput.c
date=May 27, 1994
]

Ross Ridge's mytinfo package in 1992 [cite web
url=http://www.isc.org/index.pl?/sources/utils/terminal/mytinfo.php
author=Ross Ridge
title=mytinfo posting to comp.sources.unix newsgroup
publisher=Internet Systems Consortium, Inc
date=December 27 1992
] provided a "tput" which accepted either termcap or terminfo capability names. Like the Reno implementation, it did not pass command-line arguments to parameterized capabilities. ncurses incorporated the mytinfo code in June 1995. The initial version added a -S option, and interpreted command-line parameters as described in the System V Release 4 documentation.

Portability

The Open Group defines one option (-T, to specify the terminal type) and three keywords (init, clear and reset).Most implementations accept the name of a terminal capability together with any parameters that may be needed for that.However, some implementations expect a termcap name, while others expect a terminfo name.

All System V Release 4 implementations, as well as those which are designed to be compatible, also recognize a -S option (to tell "tput" to read data from the standard input), and an additional keyword longname. They also accept command-line parameters, usually distinguishing numeric from string parameters by the form of the parameter, checking for all-numeric characters. That makes it impossible for example to set a function-key label to a string of digits. Using a different approach, ncurses determines the expected type of the parameters with a table of the terminfo capabilities which use string parameters, eliminating the ambiguity.

ee also

* List of Unix programs

Notes

External links

* [http://www.opengroup.org/onlinepubs/009695399/utilities/tput.html The Open Group Base Specifications Issue 6 "tput"]

Manual pages

* [http://invisible-island.net/ncurses/man/tput.1.html "tput(1)" manual page for ncurses]
* [http://www.ncsa.uiuc.edu/UserInfo/Resources/Hardware/IBMp690/IBM/usr/share/man/info/en_US/a_doc_lib/cmds/aixcmds5/tput.htm AIX]
* [http://marbl.com/cgi-bin/bsdi-man?proto=1.1&query=tput&msection=1&apropos=0 BSDI]
* [http://ou800doc.caldera.com/en/man/html.1/tput.1.html Caldera]
* [http://docs.hp.com/en/B3921-90010/tput.1.html HPUX]
* [http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/u_man/cat1/tput.z SGI]
* [http://docs.sun.com/app/docs/doc/816-5165/tput-1?a=view Sun]
* [http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51_HTML/MAN/MAN1/0386____.HTM Tru64]

Tutorials

* [http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html "Colours and Cursor Movement With tput" in Bash Prompt HOWTO]
* [http://www.ibm.com/developerworks/aix/library/au-learningtput/?S_TACT=105AGY06& "Discover tput" on IBM DeveloperWorks]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • List of Unix utilities — This is a list of UNIX utilities as specified by IEEE Std 1003.1 2008, which is part of the Single UNIX Specification (SUS). These utilities can be found on UNIX Operating systems and most UNIX like operating systems. List IEEE Std 1003.1 2008… …   Wikipedia

  • Программы UNIX-подобных операционных систем — Это список популярных программ, работающих в операционных системах основанных на UNIX (POSIX совместимых). Некоторые из этих программ являются стандартными для UNIX подобных систем. Содержание 1 Системный софт 1.1 Общего назначения …   Википедия

  • AWK — This article is about the programming language. For other uses, see AWK (disambiguation). AWK Paradigm(s) scripting, procedural, event driven Appeared in 1977 Designed by Alfred Aho, Peter Weinberger, and Brian Kernighan …   Wikipedia

  • ANSI escape code — ANSI code redirects here. For other uses, see ANSI (disambiguation). ANSI escape sequences are characters embedded in the text used to control formatting, color, and other output options on video text terminals. Almost all terminal emulators… …   Wikipedia

  • GRASS (programming language) — GRASS ( GRAphics Symbiosis System ) was a programming language created to script 2D vector graphics animations. GRASS was similar to BASIC in syntax, but added numerous instructions for specifying 2D object animation, including scaling,… …   Wikipedia

  • Uptime — This article is about uninterrupted system availability. For use in logistics, see Downtime. For enterprise computing, see high availability. Uptime is a measure of the time a machine has been up without any downtime. Htop adds an exclamation… …   Wikipedia

  • GNU Core Utilities — Developer(s) GNU Project Stable release 8.14  (October 12, 2011; 39 days ago (2011 10 12)) …   Wikipedia

  • Netcat — Developer(s) *Hobbit* Stable release 1.10 / March 20, 1996 Operating system UNIX …   Wikipedia

  • Minicom — For the company by this name, see Minicom Advanced Systems. For the textphone, see Telecommunications device for the deaf. Minicom Minicom run in a X11 xterm window Developer(s) Adam Lackorzynski, Martin A. Godisch …   Wikipedia

  • Horapollon — Horapollon, a Greek grammarian, flourished in the 4th century AD during the reign of Theodosius I.According to the Suda, he wrote commentaries on Sophocles, Alcaeus of Mytilene and Homer, and a work ( Te tput ) on places consecrated to the gods.… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”