SUNWcsu
The following strings will be supported as operands by the implementation in the "C" locale:
- if present, the terminal’s initialization strings will be output (is1, is2, is3, if, iprog),
- any delays (for instance, newline) specified in the entry will be set in the tty driver,
- tabs expansion will be turned on or off according to the specification in the entry, and
- if tabs are not expanded, standard tabs will be set (every 8 spaces). If an entry does not contain the information needed for any of the four above activities, that activity will silently be skipped.
This example initializes the terminal according to the type of terminal in the environment variable TERM . This command should be included in everyone’s .profile after the environment variable TERM has been exported, as illustrated on the profile(4) manual page.
example% tput init
The next example resets an AT&T 5620 terminal, overriding the type of terminal in the environment variable TERM .
example% tput -T5620 reset
The following example sends the sequence to move the cursor to row 0, column 0 (the upper left corner of the screen, usually known as the "home" cursor position).
example% tput cup 0 0
The next example echos the clear-screen sequence for the current terminal.
example% tput clear
The next command prints the number of columns for the current terminal.
example% tput cols
The following command prints the number of columns for the 450 terminal.
example% tput -T450 cols
The next example sets the shell variables bold, to begin stand-out mode sequence, and offbold, to end standout mode sequence, for the current terminal. This might be followed by a prompt:
echo "${bold}Please type in your name: ${offbold}\c"example% bold=‘tput smso‘
example% offbold=‘tput rmso‘
This example sets the exit status to indicate if the current terminal is a hardcopy terminal.
example% tput hc
This next example sends the sequence to move the cursor to row 23, column 4.
example% tput cup 23 4
The next command prints the long name from the terminfo database for the type of terminal specified in the environment variable TERM .
example% tput longname
This last example shows tput processing several capabilities in one invocation. This example clears the screen, moves the cursor to position 10, 10 and turns on bold (extra bright) mode. The list is terminated by an exclamation mark (!) on a line by itself.
example% tput -S <<!
> clear
> cup 10 10
> bold
> !
specified, indicates TRUE .
- If capname is of type string and -S is not specified, indicates capname is defined for this terminal type.
- If capname is of type boolean or string and -S is specified, indicates that all lines were successful.
- capname is of type integer.
- The requested string was written successfully.
specified, indicates FALSE .
- If capname is fo type string and -S is not specified, indicates that capname is not defined for this terminal type.