Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > T

tput(1)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

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 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

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

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

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

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.

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

/usr/share/lib/terminfo/?/*

Terminfo data base

/usr/include/curses.h

Definition files

/usr/include/term.h

STANDARDS CONFORMANCE

tput: SVID2, SVID3, XPG4

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.