ITPub博客

首页 > 应用开发 > IT综合 > SHELL 写的旋转进度指针

SHELL 写的旋转进度指针

原创 IT综合 作者:liang573728 时间:2019-03-11 21:09:06 0 删除 编辑
chinaunix上发现的,很有意思.收录下来
[@more@]
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

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/640706/viewspace-1043912/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2005-10-15

  • 博文量
    152
  • 访问量
    138357