📄 tput.1.html
字号:
has similar behavior.</PRE><H2>EXAMPLES</H2><PRE> <STRONG>tput</STRONG> <STRONG>init</STRONG> Initialize the terminal according to the type of ter- minal in the environmental variable <STRONG>TERM</STRONG>. This com- mand should be included in everyone's .profile after the environmental variable <STRONG>TERM</STRONG> has been exported, as illustrated on the <STRONG><A HREF="profile.5.html">profile(5)</A></STRONG> manual page. <STRONG>tput</STRONG> <STRONG>-T5620</STRONG> <STRONG>reset</STRONG> Reset an AT&T 5620 terminal, overriding the type of terminal in the environmental variable <STRONG>TERM</STRONG>. <STRONG>tput</STRONG> <STRONG>cup</STRONG> <STRONG>0</STRONG> <STRONG>0</STRONG> Send the sequence to move the cursor to row <STRONG>0</STRONG>, column <STRONG>0</STRONG> (the upper left corner of the screen, usually known as the "home" cursor position). <STRONG>tput</STRONG> <STRONG>clear</STRONG> Echo the clear-screen sequence for the current termi- nal. <STRONG>tput</STRONG> <STRONG>cols</STRONG> Print the number of columns for the current terminal. <STRONG>tput</STRONG> <STRONG>-T450</STRONG> <STRONG>cols</STRONG> Print the number of columns for the 450 terminal. <STRONG>bold=`tput</STRONG> <STRONG>smso`</STRONG> <STRONG>offbold=`tput</STRONG> <STRONG>rmso`</STRONG> Set the shell variables <STRONG>bold</STRONG>, to begin stand-out mode sequence, and <STRONG>offbold</STRONG>, to end standout mode sequence, for the current terminal. This might be followed by a prompt: <STRONG>echo</STRONG> <STRONG>"${bold}Please</STRONG> <STRONG>type</STRONG> <STRONG>in</STRONG> <STRONG>your</STRONG> <STRONG>name:</STRONG> <STRONG>${offbold}\c"</STRONG> <STRONG>tput</STRONG> <STRONG>hc</STRONG> Set exit code to indicate if the current terminal is a hard copy terminal. <STRONG>tput</STRONG> <STRONG>cup</STRONG> <STRONG>23</STRONG> <STRONG>4</STRONG> Send the sequence to move the cursor to row 23, col- umn 4. <STRONG>tput</STRONG> <STRONG>cup</STRONG> Send the terminfo string for cursor-movement, with no parameters substituted. <STRONG>tput</STRONG> <STRONG>longname</STRONG> Print the long name from the <STRONG>terminfo</STRONG> database for the type of terminal specified in the environmental variable <STRONG>TERM</STRONG>. <STRONG>tput</STRONG> <STRONG>-S</STRONG> <STRONG><<!</STRONG> <STRONG>></STRONG> <STRONG>clear</STRONG> <STRONG>></STRONG> <STRONG>cup</STRONG> <STRONG>10</STRONG> <STRONG>10</STRONG> <STRONG>></STRONG> <STRONG>bold</STRONG> <STRONG>></STRONG> <STRONG>!</STRONG> This example shows <STRONG>tput</STRONG> processing several capabili- ties in one invocation. It 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 (<STRONG>!</STRONG>) on a line by itself.</PRE><H2>FILES</H2><PRE> <STRONG>/usr/share/terminfo</STRONG> compiled terminal description database <STRONG>/usr/share/tabset/*</STRONG> 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 <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG></PRE><H2>EXIT CODES</H2><PRE> If the <STRONG>-S</STRONG> option is used, <STRONG>tput</STRONG> checks for errors from each line, and if any errors are found, will set the exit code to 4 plus the number of lines with errors. If no errors are found, the exit code is <STRONG>0</STRONG>. No indication of which line failed can be given so exit code <STRONG>1</STRONG> will never appear. Exit codes <STRONG>2</STRONG>, <STRONG>3</STRONG>, and <STRONG>4</STRONG> retain their usual interpretation. If the <STRONG>-S</STRONG> option is not used, the exit code depends on the type of <EM>capname</EM>: <EM>boolean</EM> a value of <STRONG>0</STRONG> is set for TRUE and <STRONG>1</STRONG> for FALSE. <EM>string</EM> a value of <STRONG>0</STRONG> is set if the <EM>capname</EM> is defined for this terminal <EM>type</EM> (the value of <EM>capname</EM> is returned on standard output); a value of <STRONG>1</STRONG> is set if <EM>capname</EM> is not defined for this ter- minal <EM>type</EM> (nothing is written to standard output). <EM>integer</EM> a value of <STRONG>0</STRONG> is always set, whether or not <EM>capname</EM> is defined for this terminal <EM>type</EM>. To determine if <EM>capname</EM> is defined for this ter- minal <EM>type</EM>, the user must test the value writ- ten to standard output. A value of <STRONG>-1</STRONG> means that <EM>capname</EM> is not defined for this terminal <EM>type</EM>. <EM>other</EM> <STRONG>reset</STRONG> or <STRONG>init</STRONG> may fail to find their respec- tive files. In that case, the exit code is set to 4 + <STRONG>errno</STRONG>. Any other exit code indicates an error; see the DIAGNOS- TICS section.</PRE><H2>DIAGNOSTICS</H2><PRE> <STRONG>tput</STRONG> prints the following error messages and sets the cor- responding exit codes. exit code error message --------------------------------------------------------------------- <STRONG>0</STRONG> (<EM>capname</EM> is a numeric variable that is not specified in the <STRONG><A HREF="terminfo.1.html">terminfo(1)</A></STRONG> database for this terminal type, e.g. <STRONG>tput</STRONG> <STRONG>-T450</STRONG> <STRONG>lines</STRONG> and <STRONG>tput</STRONG> <STRONG>-T2621</STRONG> <STRONG>xmc</STRONG>) <STRONG>1</STRONG> no error message is printed, see the <STRONG>EXIT</STRONG> <STRONG>CODES</STRONG> section. <STRONG>2</STRONG> usage error <STRONG>3</STRONG> unknown terminal <EM>type</EM> or no <STRONG>terminfo</STRONG> database <STRONG>4</STRONG> unknown <STRONG>terminfo</STRONG> capability <EM>capname</EM> <STRONG>>4</STRONG> error occurred in -S ---------------------------------------------------------------------</PRE><H2>PORTABILITY</H2><PRE> The <STRONG>longname</STRONG> and <STRONG>-S</STRONG> options, and the parameter-substitu- tion features used in the <STRONG>cup</STRONG> example, are not supported in BSD curses or in AT&T/USL curses before SVr4.</PRE><H2>SEE ALSO</H2><PRE> <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG><A HREF="stty.1.html">stty(1)</A></STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>. <STRONG><A HREF="tput.1.html">tput(1)</A></STRONG></PRE><HR><ADDRESS>Man(1) output converted with<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a></ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -