#!\bin\bash
drawper ()
{
_per=`expr $1 \* 100 / $2`
case `expr $_per / 4 % 4` in
0) _char="|" ;;
1) _char="/" ;;
2) _char="-" ;;
3) _char="\\" ;;
esac
printf "\r$_char $_per%%"
if [ $1 -eq $2 ];then
printf "\n"
fi
}
i=1
while [ $i -le 100 ]
do
drawper $i 100
i=`expr $i + 1`
done
阅读(1053) | 评论(0) | 转发(0) |