首页 > 代码库 > 打印脚本执行进度条

打印脚本执行进度条

#!/bin/sh

echo -n radio:
tput sc                                                                                                                  #保存当前光标位置
count=0
while true;
     do
         if [ $count -lt 10 ];then
             let count++;
             sleep 1;                                                                                                   #休眠1秒
             tput rc;                                                                                                   #取出当前光标位置
             tput ed
             #radia=`echo "scale=2;$count/10*100" | bc`
             #echo -n "$radia%";
             echo -n ". "
             tput sc
         else exit 0;
         fi
     done
echo
echo

打印脚本执行进度条