TPUT(1V) — USER COMMANDS
NAME
tput − query terminfo database
SYNOPSIS
/usr/5bin/tput [ -Ttype ] capname
DESCRIPTION
Note:Optional Software (System V Option). Refer to Installing UNIX on the Sun Workstation for information on how to install this command.
tput uses the terminfo(5) database to make terminal-dependent capabilities and information available to the shell. tput outputs a string if the attribute (capability name) 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, 1 for FALSE), and does no output.
OPTIONS
-Ttype indicates the type of terminal. Normally this flag is unnecessary, as the default is taken from the environment variable $TERM.
capname indicates the attribute from the terminfo database. See terminfo(5).
EXAMPLES
tput clear Echo clear-screen sequence for the current terminal.
tput cols Print the number of columns for the current terminal.
tput -T450 cols Print the number of columns for the 450 terminal.
bold=‘tput smso‘ Set shell variable "bold" to stand-out mode sequence for current terminal. This might be followed by a prompt:
echo "${bold}Please type in your name: \c"
tput hc Set exit code to indicate if current terminal is a hardcopy terminal.
FILES
/usr/5lib/terminfo/?/∗ Terminal descriptor files
/usr/5include/term.h Definition files
/usr/5include/curses.h
DIAGNOSTICS
Tput prints error messages and returns the following error codes on error:
-1 Usage error.
-2 Bad terminal type.
-3 Bad capname.
In addition, if a capname is requested for a terminal that has no value for that capname (e.g., tput -T450 lines), -1 is printed.
SEE ALSO
Sun Release 3.5 — Last change: 17 April 1986