shell模拟进度条
时间:2010-04-24 来源:chenwenming
#!/bin/bash
b=''
for ((i=0;$i<=100;i+=2))
do
printf "progress: [%-50s] %d%%\r" $b $i
sleep 0.1
b=#$b
done
echo
[root@gfs1 cwm]# sh she_t.sh
progress: [##################################################] 100%
b=''
for ((i=0;$i<=100;i+=2))
do
printf "progress: [%-50s] %d%%\r" $b $i
sleep 0.1
b=#$b
done
echo
[root@gfs1 cwm]# sh she_t.sh
progress: [##################################################] 100%
相关阅读 更多 +