专注各种脚本编程
Baidu
加入收藏夹
本站内容有下面分类知识,欢迎您的到来^_^
shell相关:指令篇 基础篇 脚本欣赏 编程实例 shell问问 shell视频教程 技巧篇 水平测试 E文资料 vi编辑器 高级Bash脚本编程指南
其他:mysql perl c语言 oracle
当前位置:| 主页>shell脚本欣赏>

编写shell脚本进度条

百度收藏 QQ搜藏

www.chinaunix.net
看看人家是怎么玩shell的,值得学习

代码如下:
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

上一篇:病毒研究之感染linux脚本程序技术 下一篇:rpm安装shell脚本-RPM-INSTALLER

power by soyo123 2007-2008