脚本】脚本实现彩色进度条"/>
【shell脚本】脚本实现彩色进度条
实现代码:
#########################################################################
# File Name: procbar.sh
# Author: liumin
# mail: 1106863227@qq
# Created Time: Sun 02 Jul 2017 09:21:46 AM CST
#########################################################################
#!/bin/bashnum=0
str='#'
max=100
pro=('|' '/' '-' '\')
while [ $num -le $max ]
do((color=30+num%8))echo -en "\e[1;"$color"m"let index=num%4printf "[%-100s %d%% %c]\r" "$str" "$num" "${pro[$index]}"let num++sleep 0.1str+='#'
done
printf "\n"
echo -e "\e[1;30;m"
进度条的原理在之前的博客有写过: http://blo
更多推荐
【shell脚本】脚本实现彩色进度条
发布评论