爱程序网

shell脚本中生成延时

来源: 阅读:

#!/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 清除从当前光标位置到行尾之间的所有内容

 

关于爱程序网 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助