📄 462.html
字号:
<td noWrap>
<div align="center">
<input maxlength=100 size=30 name=keyword2>
</div>
</td>
</tr></tbody>
</table>
</form>
</TD>
<TD rowSpan=2><IMG src="images/header_r1_c7.gif" tppabs="http://www.linuxhero.com/docs/images/header_r1_c7.gif" width=26 border=0 name=header_r1_c7></TD>
<TD><IMG height=83 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1 border=0></TD></TR>
<TR>
<TD background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif"><IMG height=22
src="images/header_r2_c1.gif" tppabs="http://www.linuxhero.com/docs/images/header_r2_c1.gif" width=296 border=0
name=header_r2_c1></TD>
<TD background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colSpan=5>
<DIV align=right><FONT class=normalfont>当前位置:
<A href="index.html" tppabs="http://www.linuxhero.com/docs/index.html">本站首页</A>
<font color="#FF6699">>></font>
<A href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</A> | <A href="copyright.html" tppabs="http://www.linuxhero.com/docs/copyright.html">版权说明</A></font></DIV>
</TD>
<TD><IMG height=22 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1
border=0></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=10 cellPadding=0 width="100%" bgColor=#ffffff
border=0>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TR>
<TD vAlign=top align=middle width="60%">
<TABLE cellSpacing=0 cellPadding=0 width="100%"
background="images/back.gif" tppabs="http://www.linuxhero.com/docs/images/back.gif" border=0>
<TBODY>
<TR>
<TD vAlign=top width="80%">
<DIV align=center>
<FORM action="search.html" tppabs="http://www.linuxhero.com/docs/search.html" method=get>
</FORM>
<TABLE cellSpacing=0 cellPadding=0 width="95%"
border=0><TBODY>
<TR>
<TD background="images/bgi.gif" tppabs="http://www.linuxhero.com/docs/images/bgi.gif"
height=30></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=3 width="95%"
align=center border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%"
border=0>
<TBODY>
<TR>
<TD vAlign=top>
<p><FONT class=normalfont><B><font color=blue>Shell高级屏幕输出</font></B></FONT><BR><FONT class=smallfont color=#ff9900>2004-04-23 15:18 pm</FONT><BR><FONT class=normalfont>作者:作者<br>来自:Linux知识宝库<br>联系方式:无名<br><br>对于在Shell下面编写屏幕程序,大家使用echo命令比较多,而且此命令也比较快。下面介绍的是比较漂亮<br>
一点的方法,但是速度比较慢。要实现这一点,系统上需要一个彩色监视器和tput命令。<br>
一.使用<br>
在使用tput前,需要在脚本或命令行中使用tput命令初始化终端。<br>
$ tput init<br>
tput产生三种不同的输出:字符型、数字型和布尔型(真/假)。<br>
/字符串输出/<br>
下面是大部分常用字符串:<br>
名字含义<br>
bel 警铃<br>
blink 闪烁模式<br>
bold 粗体<br>
civis 隐藏光标<br>
clear 清屏<br>
cnorm 不隐藏光标<br>
cup 移动光标到屏幕位置( x,y)<br>
el 清除到行尾<br>
ell 清除到行首<br>
smso 启动突出模式<br>
rmso 停止突出模式<br>
smul 开始下划线模式<br>
rmul 结束下划线模式<br>
sc 保存当前光标位置<br>
rc 恢复光标到最后保存位置<br>
sgr0 正常屏幕<br>
rev 逆转视图<br>
<br>
/数字输出/<br>
以下是大部分常用数字输出。<br>
名字含义<br>
cols 列数目<br>
ittab设置宽度<br>
lines 屏幕行数<br>
<br>
/布尔输出/<br>
在tput中只有两种布尔操作符。<br>
名字含义<br>
chts 光标不可见<br>
hs 具有状态行<br>
<br>
例如:tput clear 清除屏幕<br>
<br>
二.光标位置<br>
可以用tput将光标放在屏幕任意位置。格式为:<br>
cup r c<br>
r为从上至下屏幕行数, c为穿过屏幕列数。<br>
最好将之编成函数,这样就可以把行和列的值传递给它。<br>
例子:tput cup 2 3命令将光标放到第2行、第3列。<br>
<br>
三.菜单中使用颜色<br>
对域使用颜色可以使数据输入屏幕看起来更加专业。下面将使用的颜色是A N S I标准颜<br>
色,并不是所有颜色都适合于所有系统。下面列出了大部分常用颜色。<br>
1. 前景色:<br>
数字颜色数字颜色<br>
3 0 黑色3 4 蓝色<br>
3 1 红色3 5 紫色<br>
3 2 绿色3 6 青色<br>
3 3 黄(或棕)色3 7 白(或灰)色<br>
2. 背景色:<br>
数字颜色数字颜色<br>
4 0 黑色4 4 青色<br>
4 1 红色4 5 蓝色<br>
4 2 绿色4 6 青色<br>
4 3 黄(或棕)色4 7 白(或灰)色<br>
<br>
例子:黑底绿字echo "