一个Shell小脚本——旋转的斜杠

  话不多说,请从代码中寻找乐趣吧!

#!/bin/bash

#----中断计数器----#
incr=1

#----旋转的斜杠----#
spin="/-|"
echo -en "        Please wait ...        "

#这里就是实现旋转效果的代码#
while true
do
    printf "${spin:incr++%${#spin}:1}    "
    sleep 0.2
done
原文地址:https://www.cnblogs.com/vnix/p/spin-shell.html