NAME
tput - Queries the terminal information database
SYNOPSIS
tput [-T type] capability_name
The tput command uses the terminfo database to make
terminal-dependent information available to the shell.
FLAGS
-T type
Specifies the type of terminal. By default, the value
of type is taken from the environment variable $TERM.
DESCRIPTION
The capability_name argument indicates the attribute from
the terminfo file. The output of tput is a string if the
attribute capability_name is of the type string, or an
integer if the attribute is of the type integer. If
capability_name is of the type Boolean, tput sets the exit
value (0 for TRUE, 1 for FALSE) and produces no other out-
put. For more information, see terminfo(4) in the OSF/1
Programmer's Reference.
The following are among the strings that can be entered as
the capability_name argument:
clear
Displays the clear-screen sequence.
init
Displays the sequence that initializes the user's termi-
nal.
reset
Displays the sequence that resets the user's terminal.
EXAMPLES
1. To echo the clear-screen sequence for the current ter-
minal, enter:
tput clear
2. To display the number of columns for the current termi-
nal, enter:
tput cols
3. To set and unset the highlight-mode sequences for the
current terminal, enter:
bold=`tput smso`
unbold=`tput rmso`
This is followed by a prompt:
echo "${bold}Please type in your name:${unbold} \c"
4. To set the exit value to indicate if the current termi-
nal is a hard-copy terminal, enter:
tput hc
FILES
/usr/share/lib/terminfo/?/*
Terminal information database.
/usr/include/term.h
Definition files.
/usr/include/curses.h
curses library definition file.
EXIT VALUES
0 Success or FALSE Boolean value.
1 TRUE Boolean value.
2 Usage error.
3 No information on terminal.
4 Capability is invalid.
RELATED INFORMATION
Commands: stty(1).
Files: terminfo(4).
Acknowledgement and Disclaimer