shell tput 用法
2016-07-12 15:56
302 查看
tput 是用于终端在显示的时候增强用户体验效果的一个命令, 利用tput可以是shell脚本更加完美. tput可以使你的黑布垃圾的终端重现活力.
脚本代码如下:
#!/bin/bash
echo -n Count:
tput sc
count=0
while true;
do
if [ $count -lt 40 ];
then
let count++;
sleep 1
tput rc
tput ed
echo -n $count;
else exit 0;
fi
done
这里
tput sc 清空屏幕
tput rc 恢复光标最后保存的位置
tput ed 清空光标位置到设备尾部的数据
脚本代码如下:
#!/bin/bash
echo -n Count:
tput sc
count=0
while true;
do
if [ $count -lt 40 ];
then
let count++;
sleep 1
tput rc
tput ed
echo -n $count;
else exit 0;
fi
done
这里
tput sc 清空屏幕
tput rc 恢复光标最后保存的位置
tput ed 清空光标位置到设备尾部的数据
相关文章推荐
- Linux socket 初步
- android wifi 无线调试
- Linux Kernel 4.0 RC5 发布!
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- 动态清空 nohup 输出文件
- install scrapy with pip and easy_install
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)