首页 > 系统服务 > 详细

shell之获取终端信息

时间:2018-11-21 14:16:24      阅读:206      评论:0      收藏:0      [点我收藏+]
#!/bin/bash
#tput和stty是两款终端处理工具
#获取列数和行数
tput cols
tput lines
#打印当前终端名
tput longname
#移动光标 移动光标到100 100
tput cup 100 100
#设置终端背景色 0-7
tput setb 0
#设置终端前景色 0-7
tput setf 7
tput bold #设置粗体
#设置下划线的起止: 
tput smul
tput rmul
# 删除从当前光标位置到行尾的所有内容: 
tput ed
tput sc#保存光标的位置
tput rc# 恢复光标到上一次保存的位置
#stty实现不显示输入内容
echo -e "输入密码:"
stty -echo
read password
stty echo
echo
echo password read.
#选项-echo禁止将输出发送到终端,而选项echo则允许发送输出

shell之获取终端信息

原文:https://www.cnblogs.com/mrwuzs/p/9994327.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!