实例一:
效果: progress:[##################################################]100%
------------------------------------------------------------------
#!/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
-------------------------------------------------------------------
实例二:
利用-\|/实现旋转滚动效果
-------------------------------------------------------------------
#!/bin/bash
i=0
while [ $i -lt 20 ]
do
for j in '-' '\' '|' '/'
do
printf "intel testing : %s\r" $j
sleep 0.1
((i++))
done
done
-------------------------------------------------------------------
阅读(4795) | 评论(0) | 转发(1) |