Queries the terminfo database for terminal-dependent information
tput [ -T Type ] [ CapabilityName {clear, init, longname, reset} [ Parameters... ]]
tput [ -S ]
The tput command uses the terminfo database to make terminal-dependent information available to the shell. The tput command outputs a string if the attribute CapabilityName is of type string. The output string is an integer if the attribute is of type integer. If the attribute is of type Boolean, the tput command sets the exit value (0 for TRUE, 1 for FALSE), and produces no other output.
The xterm terminal description in the DEC.TI file on AIX Version 4 provides underline mode by using the SGR attribute. The SMUL and RMUL attributes are not currently defined in the XTERM terminal description on AIX Version 4. Use the more generic capability named SGR.
tput sgr x y
Where x is either a 1 or a 0 to turn standout mode on or off respectively, and y is either a 1 or a 0 to turn underline mode on or off respectively. See the article "terminfo file format" for more details on the SGR capability.
tput sgr 0 1 turn off standout; turn on underline tput sgr 0 0 turn off standout; turn off underline tput sgr 1 1 turn on standout; turn on underline tput sgr 1 0 turn on standout; turn off underline
In addition to the capability names, the following strings are supported as arguments to the tput subroutine.
This command returns the following exit values:
tput clear
tput cols
bold=`tput smso` offbold='tput rmso'
Entering these commands might be followed by the following prompt:
echo "${bold}Name: ${offbold} \c"
tput hc
tput init
/usr/share/lib/terminfo/?/* | Contains the terminal descriptor files. |
/usr/include/term.h | Contains the definition files. |
The stty command.
The terminfo file format.