Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ tput(C) — OpenDesktop 1.0.0y

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

terminfo(M)

terminfo(S)

tic(C)

stty(C)


     TPUT(C)                                    UNIX System V



     Name
          tput - queries the terminfo database


     Syntax
          tput [ -Ttype ] attribute


     Description
          The command tput uses the  terminfo  database  to  make  the
          values  of  terminal-dependent  attributes  available to the
          shell. tput outputs a string if the terminal attribute 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 if the terminal has the
          capability, 1 for false if it  does  not)  and  produces  no
          output.

          The -T flag indicates the type of  the  terminal.   Normally
          this option is unnecessary, as the default is taken from the
          environment variable TERM.

          attribute is the terminal capability name from the  terminfo
          database.


     Examples
          tput clear            Echo clear-screen sequence for  the
                                current terminal.

          tput cols             Print the number of columns for the
                                current terminal.

          tput -T450 cols       Print the number of columns for the
                                450 terminal.

          bold='tput smso'
          offbold='tput rmso'   Set the shell variables ``bold'' to
                                begin  standout  mode  sequence and
                                ``offbold'' to  end  standout  mode
                                sequence  for the current terminal.
                                This might be followed by a prompt,
                                such as:

                                     echo "${bold}Name:  ${offbold}\c"


          tput hc               Set exit code to  indicate  if  the
                                current   terminal  is  a  hardcopy
                                terminal.


     Files
          /usr/lib/terminfo/*/*    -Compiled    terminal    capability
          database.


     See Also
          terminfo(M), terminfo(S), tic(C), stty(C)


     Notes
          If the attribute is  of  type  boolean,  a  value  of  0  is
          returned for TRUE and a value of 1 for FALSE.

          If the attribute is of type string or integer, a value of  0
          is  returned  upon  successful  completion.  Any other value
          returned indicates an error.  For example, the specification
          of a bad attribute (any capability name that is not found in
          the terminfo database) produces an error.


     Standards Conformance
          tput is conformant with:

          AT&T SVID Issue 2, Select Code 307-127.


     (printed 8/24/89)                                  TPUT(C)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026