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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM