tput(1)
NAME
tput − query terminfo database
SYNOPSIS
tput [-T type] capname
DESCRIPTION
tput uses the terminfo database to make terminal-dependent capabilities and information available to the shell (see terminfo(4)). tput outputs a string if the attribute (capname) 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 produces no output.
Command-Line Arguments
tput recognizes the following command-line arguments:
-Ttype Indicates the type of terminal. Normally this flag is unnecessary because the default is taken from the environment variable TERM.
capname Indicates the attribute from the terminfo database. See terminfo(4). In addition, the following capnames are supported:
clear Echo the clear-screen sequence for the current terminal.
init Echo the initialize sequence for the current terminal.
reset Echo the sequence that will reset the current terminal.
The words clear, init, and reset are replaced by their local language equivalent (see EXTERNAL INFLUENCES below).
EXTERNAL INFLUENCES
Environment Variables
LANG determines the translation of the words clear, init, and reset.
LC_ALL determines the locale to use. This overrides settings of other environment variables.
LC_MESSAGES determines the language to use for messages.
TERM determines the terminal type if the -T option is not specified.
EXAMPLES
Echo clear-screen sequence for the current terminal.
tput clear
Print the number of columns for the current terminal.
tput cols
Print the number of columns for the hp2623 terminal.
tput -Thp2623 cols
Set shell variable
bold to stand-out-mode sequence for current terminal.
bold=‘tput smso‘
This might be followed by a prompt:
echo "${bold}Please type in your name: \c"
Set exit code to indicate if current terminal is a hardcopy terminal.
tput hc
DIAGNOSTICS
tput fails, prints an error message, and returns the corresponding value when any of the following conditions are encountered.
2 Usage error.
3 Bad terminal type.
4 Bad capability name.
In addition, if a capability name is requested for a terminal that has no value for that capability name (such as tput -Thp2623 vt), -1 is printed.
FILES
/usr/lib/terminfo/?/* terminfo data base
/usr/include/curses.h definition files
/usr/include/term.h
SEE ALSO
STANDARDS CONFORMANCE
tput: SVID2
Hewlett-Packard Company — HP-UX Release 9.03: April 1994