HP-UX Reference (11i v3 07/02) - 1 User Commands N-Z (vol 2)

t
tput(1) tput(1)
NAME
tput - query terminfo database
SYNOPSIS
tput [-T type] capname ...
tput [-T type] capname [parms ...]
tput -S
DESCRIPTION
The tput command uses the terminfo database to make terminal-dependent capabilities and informa-
tion available to the shell (see terminfo(4)). The
tput command outputs a string if the attribute (cap-
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 produces no output.
Command-line Arguments
The
tput command 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.
parms If the capname takes optional numeric parameters, the parms will be placed in the
string output by tput.
-S The capnames are read from stdin and multiple capnames are allowed. Only one cap-
name is allowed per line when reading from stdin.
EXTERNAL INFLUENCES
Environment Variables
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 70092 terminal.
tput -T70092 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 hard copy terminal.
tput hc
HP-UX 11i Version 3: February 2007 1 Hewlett-Packard Company 337