#!/bin/bash
b=''
for ((i=0;$i<=100;i+=4))
do
printf "loading:[%-25s]%d%%\r" $b $i
sleep 0.1
b=#$b
done
echo
效果
loading:[#########################]100%
#!/bin/bash
b=''
for ((i=0;$i<=100;i+=4))
do
printf "loading:[%-25s]%d%%\r" $b $i
sleep 0.1
b=#$b
done
echo
loading:[#########################]100%
本文标题:shell进度条模拟
本文链接:https://www.haomeiwen.com/subject/nyeiuftx.html
网友评论