#!/bin/bash i=0 str=‘#‘ ch=(‘|‘ ‘\‘ ‘-‘ ‘/‘) index=0 while [ $i -le 25 ] do printf "[%-25s][%d%%][%c]\r" $str $(($i*4)) ${ch[$index]} str+=‘#‘ let i++ let index=i%4 sleep 0.1 done printf "\n"
时间: 2024-10-07 01:45:24
#!/bin/bash i=0 str=‘#‘ ch=(‘|‘ ‘\‘ ‘-‘ ‘/‘) index=0 while [ $i -le 25 ] do printf "[%-25s][%d%%][%c]\r" $str $(($i*4)) ${ch[$index]} str+=‘#‘ let i++ let index=i%4 sleep 0.1 done printf "\n"