tput命令初學

先貼一個剛剛碰到的腳本文件,學習sleep時碰到的,然後又去google了一下tput~

#!/bin/bash
#Filename:sleep.sh
echo -n Count:
tput sc //保存光標位置

count=0;
while true;
do
if [ $count -lt 10 ];
then let count++;
sleep 1;
tput rc //恢復光標位置到最後保存的位置
tput ed //清楚從當前光標到設備末尾的數據
echo -n $count;
else exit 0;
fi
done

另外貼一下tput命令解析的地址:http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html

也可以man tput試一下啊~


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章