shell之获取终端信息

#!/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则允许发送输出

猜你喜欢

转载自www.cnblogs.com/mrwuzs/p/9994327.html
今日推荐