random+tput 更改屏幕显示
来源:互联网 发布:淘宝剑三代练 编辑:程序博客网 时间:2024/05/17 23:54
trap 读取信号量 执行相应的操作
tput 更改终端显示命令 --tput cup 20 30 设置光标显示在20行30列的位置 tput clear 清屏
这个script 完全是出于兴趣 不见得有什么实际用途
功能说明: 9行设置接受这几项信息量无操作,主要目地是不让ctrl+c ctrl+z 结束此script
12-26一个根据当前屏幕大小自动生成随机数的函数
read -t 1 设置timeout second 如果一秒用户不输入 还会直接运行
最后如果执行100次 清屏 再重新输出$ 直到用户输入 ignore 为止
vim chageTerminalstyle.sh
1 #!/bin/bash2
3 ##
4 # random to change prompt position
5 # not interrupt
6 # press ignore leave
7 ##
8
9 trap '' 1 2 3 18 20 24
10
11 #produce random line or columns of screen
12 function randomPro()
13 {
14 random=$RANDOM;
15 num=$(date +%s);
16 ((random=num+random))
17 column=`tput cols`
18 line=`tput lines`
19 ((column=random%column+1))
20 ((line=random%line+1))
21 if [ $1 = "line" ] ; then
22 echo $line
23 else
24 echo $column;
25 fi
26 }
27
28 #hide the prompt
29 stty -echo
30 cnt=0;
31
32 read -t 1 input
33 if [ -z "$input" ] ; then
34 input='xx'
35 fi
36
37 # read ignore then stop
38 until [ $input = "ignore" ]
39 do
40 ((cnt=$cnt+1));
41 line=$(randomPro line);
42 column=$(randomPro col);
43 tput cup $line $column
44 #sleep 2
45 echo "$"
46 read -t 2 input
47 if [ -z $input ] ; then
48 input='xx'
49 fi
50
51 if [ "$cnt" -eq 100 ] ; then
52 tput clear
53 cnt=1
54 fi
55
56 done
57 # open the prompt
58 stty echo
- random+tput 更改屏幕显示
- 创建屏幕输出:tput
- 更改屏幕显示区
- 使用tput创建屏幕输出
- tput
- [IMX6Q][Android6.0.1_r3]之系统屏幕显示默认设置更改
- Ubuntu 虚拟机显示屏幕大小更改 + 与window文件交互
- 更改dialog样式activity在屏幕中显示的位置
- tput使用
- tput、set
- Linux tput
- Linux tput
- tput使用方法
- tput 命令
- tput 命令
- 动态更改屏幕方向
- linux 更改屏幕亮度
- android 屏幕截图时,如何更改截图内容,将两个bitmap合并一起显示图像
- Break the list items Inheritance permission and custom the permission with ItemAdded Event
- ASP.NET创建Web服务之管理Web服务状态
- stm32库函数void SystemInit (void)分析
- 【转发】使用tomcat7创建异步servlet
- 研究:Liferay研究(六)Liferay中如何获取相应的portlet实例Id和portletId
- random+tput 更改屏幕显示
- 09-13 PHP study code
- SIGINT,SIGQUIT,SIGTERM,SIGQUIT 这些停止进程的信号有什么不同
- 自行实现Solr重复分词过滤器
- Cocos2d-X内存管理研究
- Django 静态文件和媒体文件配置
- ssziparchive 解压 和 压缩
- 如何使用Putty(SSH)登录管理Linux服务器
- IOC容器的经典解释