


tput(1)                                                   tput(1)


NNAAMMEE
       ttppuutt - initialize a terminal or query terminfo database

SSYYNNOOPPSSIISS
       ttppuutt [--TT_t_y_p_e] _c_a_p_n_a_m_e [_p_a_r_m_s ... ]
       ttppuutt [--TT_t_y_p_e] iinniitt
       ttppuutt [--TT_t_y_p_e] rreesseett
       ttppuutt [--TT_t_y_p_e] lloonnggnnaammee
       ttppuutt --SS  <<<<

DDEESSCCRRIIPPTTIIOONN
       The  ttppuutt  utility  uses the tteerrmmiinnffoo database to make the
       values of terminal-dependent capabilities and  information
       available to the shell (see sshh(1)), to initialize or reset
       the terminal, or return the long  name  of  the  requested
       terminal  type.   ttppuutt  outputs  a string if the attribute
       (_c_a_pability _n_a_m_e) is of type string, or an integer if  the
       attribute is of type integer.  If the attribute is of type
       boolean, ttppuutt simply sets the exit code (00 for TRUE if the
       terminal  has the capability, 11 for FALSE if it does not),
       and produces no output.  Before using a value returned  on
       standard  output,  the user should test the exit code [$$??,
       see sshh(1)] to be sure it is 00.  (See the  EEXXIITT  CCOODDEESS  and
       DDIIAAGGNNOOSSTTIICCSS  sections.)   For a complete list of capabili-
       ties and  the  _c_a_p_n_a_m_e  associated  with  each,  see  tteerr--
       mmiinnffoo(4).

       --TT_t_y_p_e indicates  the  _t_y_p_e  of  terminal.   Normally this
              option is unnecessary, because the default is taken
              from the environment variable TTEERRMM.  If --TT is spec-
              ified, then the shell variables LLIINNEESS  and  CCOOLLUUMMNNSS
              and the layer size [see llaayyeerrss(1)] will not be ref-
              erenced.

       _c_a_p_n_a_m_e
              indicates the attribute from the tteerrmmiinnffoo database.

       _p_a_r_m_s  If the attribute is a string that takes parameters,
              the arguments _p_a_r_m_s will be instantiated  into  the
              string.   An all numeric argument will be passed to
              the attribute as a number.

       --SS     allows more than one capability per  invocation  of
              ttppuutt.  The capabilities must be passed to ttppuutt from
              the standard input instead of from the command line
              (see  example).   Only  one  _c_a_p_n_a_m_e is allowed per
              line.  The --SS option changes the meaning of  the  00
              and  11  boolean and string exit codes (see the EXIT
              CODES section).

       iinniitt   If the tteerrmmiinnffoo database is present  and  an  entry
              for the user's terminal exists (see --TT_t_y_p_e, above),
              the following will occur: (1) if present, the  ter-
              minal's initialization strings will be output (iiss11,



                                                                1





tput(1)                                                   tput(1)


              iiss22, iiss33, iiff, iipprroogg), (2) any  delays  (e.g.,  new-
              line) specified in the entry will be set in the tty
              driver, (3) tabs expansion will be turned on or off
              according  to  the  specification in the entry, and
              (4) 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.

       rreesseett  Instead of putting out initialization strings,  the
              terminal's  reset strings will be output if present
              (rrss11, rrss22, rrss33, rrff).  If the reset strings are  not
              present,  but  initialization strings are, the ini-
              tialization strings  will  be  output.   Otherwise,
              rreesseett acts identically to iinniitt.

       lloonnggnnaammee
              If  the  tteerrmmiinnffoo  database is present and an entry
              for the user's terminal exists (see --TT_t_y_p_e  above),
              then the long name of the terminal will be put out.
              The long name is the last name in the first line of
              the terminal's description in the tteerrmmiinnffoo database
              [see tteerrmm(5)].

EEXXAAMMPPLLEESS
       ttppuutt iinniitt
            Initialize the terminal according to the type of ter-
            minal  in the environmental variable TTEERRMM.  This com-
            mand should be included in everyone's .profile  after
            the environmental variable TTEERRMM has been exported, as
            illustrated on the pprrooffiillee(4) manual page.

       ttppuutt --TT55662200 rreesseett
            Reset an AT&T 5620 terminal, overriding the  type  of
            terminal in the environmental variable TTEERRMM.

       ttppuutt ccuupp 00 00
            Send the sequence to move the cursor to row 00, column
            00 (the upper left corner of the screen, usually known
            as the "home" cursor position).

       ttppuutt cclleeaarr
            Echo the clear-screen sequence for the current termi-
            nal.

       ttppuutt ccoollss
            Print the number of columns for the current terminal.

       ttppuutt --TT445500 ccoollss
            Print the number of columns for the 450 terminal.

       bboolldd==``ttppuutt ssmmssoo`` ooffffbboolldd==``ttppuutt rrmmssoo``
            Set the shell variables bboolldd, to begin stand-out mode
            sequence, and ooffffbboolldd, to end standout mode sequence,



                                                                2





tput(1)                                                   tput(1)


            for  the current terminal.  This might be followed by
            a prompt: eecchhoo  ""$${{bboolldd}}PPlleeaassee  ttyyppee  iinn  yyoouurr  nnaammee::
            $${{ooffffbboolldd}}\\cc""

       ttppuutt hhcc
            Set  exit code to indicate if the current terminal is
            a hardcopy terminal.

       ttppuutt ccuupp 2233 44
            Send the sequence to move the cursor to row 23,  col-
            umn 4.

       ttppuutt lloonnggnnaammee
            Print  the  long  name from the tteerrmmiinnffoo database for
            the type of terminal specified in  the  environmental
            variable TTEERRMM.

       ttppuutt --SS <<<<!!
       >> cclleeaarr
       >> ccuupp 1100 1100
       >> bboolldd
       >> !!

            This  example shows tput processing several capabili-
            ties 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.

FFIILLEESS
       @@TTEERRMMIINNFFOO@@
              compiled terminal description database

       //uussrr//iinncclluuddee//ccuurrsseess..hh
              ccuurrsseess(3X) header file

       //uussrr//iinncclluuddee//tteerrmm..hh
              tteerrmmiinnffoo header file

       //uussrr//lliibb//ttaabbsseett//**
              tab settings for some terminals, in a format appro-
              priate  to  be  output  to  the  terminal   (escape
              sequences  that  set  margins  and  tabs); for more
              information, see the "Tabs and Initialization" sec-
              tion of tteerrmmiinnffoo(4)

SSEEEE AALLSSOO
       cclleeaarr(1),  ssttttyy(1),  ttaabbss(5).   pprrooffiillee(5), tteerrmmiinnffoo(4) in
       the _S_y_s_t_e_m _A_d_m_i_n_i_s_t_r_a_t_o_r'_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l.   Chapter  10
       of the _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e.

EEXXIITT CCOODDEESS
       If  _c_a_p_n_a_m_e  is  of  type boolean, a value of 00 is set for
       TRUE and 11 for FALSE unless the --SS option is used.



                                                                3





tput(1)                                                   tput(1)


       If _c_a_p_n_a_m_e is of type string, a value of 00 is set  if  the
       _c_a_p_n_a_m_e  is  defined  for this terminal _t_y_p_e (the value of
       _c_a_p_n_a_m_e is returned on standard output); a value of  11  is
       set  if  _c_a_p_n_a_m_e  is not defined for this terminal _t_y_p_e (a
       null value is returned on standard output).

       If _c_a_p_n_a_m_e is of type boolean or string and the --SS  option
       is  used,  a  value  of 00 is returned to indicate that all
       lines were successful.  No indication of which line failed
       can be given so exit code 11 will never appear.  Exit codes
       22, 33, and 44 retain their usual interpretation.

       If _c_a_p_n_a_m_e is of type integer, a value of 00 is always set,
       whether  or not _c_a_p_n_a_m_e is defined for this terminal _t_y_p_e.
       To determine if _c_a_p_n_a_m_e is defined for this terminal _t_y_p_e,
       the  user must test the value of standard output.  A value
       of --11 means that _c_a_p_n_a_m_e is not defined for this  terminal
       _t_y_p_e.

       Any  other  exit code indicates an error; see the DIAGNOS-
       TICS section.

DDIIAAGGNNOOSSTTIICCSS
       ttppuutt prints the following error messages and sets the cor-
       responding exit codes.

       exit code   error message
       00           (_c_a_p_n_a_m_e is a numeric variable that is not specified in the
                   tteerrmmiinnffoo(4) database for this terminal type, e.g.
                   ttppuutt --TT445500 lliinneess and ttppuutt --TT22662211 xxmmcc)
       11           no error message is printed, see the EEXXIITT CCOODDEESS section.
       22           usage error
       33           unknown terminal _t_y_p_e or no tteerrmmiinnffoo database
       44           unknown tteerrmmiinnffoo capability _c_a_p_n_a_m_e

NNOOTTEESS
       The   lloonnggnnaammee   and   --SS   options,  and  the  parameter-
       substitution features used in the  ccuupp  example,  are  not
       supported in BSD curses or in AT&T/USL curses before SVr4.


















                                                                4


