第 8 章 Shell Terminal

简介:

dialog, whiptail, gdialog, kdialog and nautilus

目录

8.1. terminal
8.1.1. resize - set TERMCAP and terminal settings to current xterm window size
8.1.2. tset, reset - terminal initialization
8.1.3. stty - change and print terminal line settings
8.2. tput
8.2.1. Change the prompt color using tput
8.3. dialog
8.3.1. --inputbox
8.4. whiptail - display dialog boxes from shell scripts
8.4.1. --msgbox
8.4.2. --infobox
8.4.3. --yesno
8.4.4. --inputbox
8.4.5. --passwordbox
8.4.6. --textbox
8.4.7. --checklist
8.4.8. --radiolist
8.4.9. --menu
8.4.10. --gauge

8.1. terminal

8.1.1. resize - set TERMCAP and terminal settings to current xterm window size

显示终端屏幕的尺寸

$ resize
COLUMNS=151;
LINES=46;
export COLUMNS LINES;		
			

设置终端屏幕的尺寸

eval `resize`
			

8.1.2. tset, reset - terminal initialization

tset -e ^? 设置Backspace删除前面一个字符
tset -k ^C 设置删除一行
			

建议使用stty替代tset

8.1.3. stty - change and print terminal line settings

$ stty
speed 38400 baud; line = 0;
eol = M-^?; eol2 = M-^?; swtch = M-^?;
ixany iutf8

$ stty -a
speed 115200 baud; rows 46; columns 151; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

			
OLDCONFIG=`stty -g`      # save configuration
stty -echo               # do not display password
echo "Enter password: \c"
read PASSWD              # get the password
stty $OLDCONFIG          # restore configuration			
			





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
23天前
|
弹性计算 Shell Perl
ecs服务器shell常用脚本练习(二)
【4月更文挑战第1天】shell代码训练(二)
106 1
|
26天前
|
Java Shell
SpringBoot启动脚本Shell
SpringBoot启动脚本Shell
17 0
|
3天前
|
Java 关系型数据库 MySQL
Elasticsearch【问题记录 01】启动服务&停止服务的2类方法【及 java.nio.file.AccessDeniedException: xx/pid 问题解决】(含shell脚本文件)
【4月更文挑战第12天】Elasticsearch【问题记录 01】启动服务&停止服务的2类方法【及 java.nio.file.AccessDeniedException: xx/pid 问题解决】(含shell脚本文件)
28 3
|
6天前
|
运维 监控 Shell
利用Shell脚本编写局域网监控软件:实时监测主机连接情况
本文介绍了如何使用Shell脚本创建一个局域网监控工具,以实时检查主机连接状态。脚本包括扫描IP地址范围检测主机可达性及使用`netstat`监控ESTABLISHED连接。此外,还展示了如何每60秒将连接数数据自动提交到指定网站API,以便实时跟踪网络活动。这个自动化监控系统有助于提升网络安全性和故障排查效率。
26 0
|
7天前
|
Shell
Shell脚本之流程控制语句
Shell脚本之流程控制语句
|
8天前
|
JSON 运维 监控
训练shell常用脚本练习(三)
【4月更文挑战第14天】shell代码训练(三)
27 1
|
12天前
|
存储 弹性计算 Shell
ecs服务器shell常用脚本练习(十)
【4月更文挑战第11天】shell代码训练(十)
143 0
|
12天前
|
弹性计算 Shell Go
ecs服务器shell常用脚本练习(九)
【4月更文挑战第10天】shell代码训练(八)
136 0
|
16天前
|
弹性计算 Shell Linux
ecs服务器shell常用脚本练习(六)
【4月更文挑战第4天】shell代码训练(六)
109 0