tput(1) tput(1)
NAME [Toc] [Back]
tput - query terminfo database
SYNOPSIS [Toc] [Back]
tput [-T type] capname...
tput [-T type] capname [parms...]
tput -S
DESCRIPTION [Toc] [Back]
The tput command uses the terminfo database to make terminal-dependent
capabilities and information available to the shell (see terminfo(4)).
The tput command 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 [Toc] [Back]
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 capname is allowed
per line when reading from stdin.
EXTERNAL INFLUENCES [Toc] [Back]
Environment Variables
LC_ALL determines the locale to use. This overrides settings of other
environment variables.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003
tput(1) tput(1)
LC_MESSAGES determines the language to use for messages.
TERM determines the terminal type if the -T option is not specified.
EXAMPLES [Toc] [Back]
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
Clear the screen, move the cursor to line 10, column 20 and turn on
bold.
tput -S <<EOF
clear
cup 10 20
bold
EOF
RETURN VALUE [Toc] [Back]
If capname is of type boolean, then the exit code is set to 0 for true
and 1 for false.
If capname is not of type boolean and tput fails, an error message is
printed, and exit code is set to one of the following depending on the
failure:
0 The capability name is of type integer and does not exist.
2 Usage error.
3 Unknown terminal type.
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003
tput(1) tput(1)
4 Unknown capability name.
>4 An error occurred.
If the exit code is 0, a -1 is printed if a capability name of type
integer is requested for a terminal that has no entry for that
capability name in the terminfo database (such as tput -Thp70092 vt).
FILES [Toc] [Back]
/usr/share/lib/terminfo/?/* Terminfo data base
/usr/include/curses.h Definition files
/usr/include/term.h
SEE ALSO [Toc] [Back]
stty(1), untic(1M), terminfo(4).
STANDARDS CONFORMANCE [Toc] [Back]
tput: SVID2, SVID3, XPG4
Hewlett-Packard Company - 3 - HP-UX 11i Version 2: August 2003 [ Back ] |