知识点
sleep
tput 终端处理工具
tput sc 存储光标位置
tput rc 恢复光标位置
tput ed 清除从当前光标位置到行尾之间的所有内容,使得旧的count值可以被清除并写入新值
## 脚本名称 sleep.sh
#!/bin/bash
echo -n Count:
tput sc
while true
do
if [ $count -lt 40 ]; then
let count++
sleep 1
tput rc
tput ed
echo -n $count
else exit 0
fi
done