unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (HP-UX-11.11)
Page:
Section:
Apropos / Subsearch:
optional field



 tput(1)							     tput(1)




 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.




 Hewlett-Packard Company	    - 1 -   HP-UX Release 11i: November 2000






 tput(1)							     tput(1)




      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 <&lt&lt&lt;<&lt&lt&lt;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.




 Hewlett-Packard Company	    - 2 -   HP-UX Release 11i: November 2000






 tput(1)							     tput(1)




	    4	Unknown capability name.
	   >&gt&gt&gt;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

 SEE ALSO
      stty(1), untic(1M), terminfo(4).

 STANDARDS CONFORMANCE
      tput: SVID2, SVID3, XPG4





































 Hewlett-Packard Company	    - 3 -   HP-UX Release 11i: November 2000