TPUT(C) XENIX System V TPUT(C)
Name
tput - Queries the terminfo database.
Syntax
tput [ -Ttype ] attribute
Description
The command tput uses the terminfo database to make the
values of terminal-dependent attributes available to the
shell. tput outputs a string if the terminal attribute is of
type string, or an integer if the attribute is of type
integer. If the attribute is of type Boolean, tput simply
sets the exit code (0 for true if the terminal has the
capability, 1 for false if it does not) and produces no
output.
The -T flag indicates the type of the terminal. Normally
this option is unnecessary, as the default is taken from the
environment variable TERM.
attribute is the terminal capability name from the terminfo
database.
Examples
tput clear Echo clear-screen sequence for the
current terminal.
tput cols Print the number of columns for the
current terminal.
tput -Tvt100 cols Print the number of columns for the
vt100 terminal.
bold=`tput smso`
offbold=`tput rmso` Set the shell variables ``bold'' to
begin standout mode sequence and
``offbold'' to end standout mode
sequence for the current terminal.
This might be followed by a prompt,
such as:
echo "${bold}Name: ${offbold}\c"
tput hc Set exit code to indicate if the
current terminal is a hardcopy
terminal.
Files
/usr/lib/terminfo/*/* -Compiled terminal capability
database.
Page 1 (printed 2/7/91)
TPUT(C) XENIX System V TPUT(C)
See Also
terminfo(M), terminfo(S), tic(C), stty(C)
Notes
If the attribute is of type boolean, a value of 0 is
returned for TRUE and a value of 1 for FALSE.
If the attribute is of type string or integer, a value of 0
is returned upon successful completion. Any other value
returned indicates an error. For example, the specification
of a bad attribute (any capability name that is not found in
the terminfo database) produces an error.
Page 2 (printed 2/7/91)