#!/bin/sh
statu_show(){
spin='-\|/'
i=0
while kill -0 $pid 2>/dev/null
do
i=$(( (i+1) %4 ))
printf "\rthe process has running,please waitting...[${spin:$i:1}]"
sleep .1
done
echo
}
sleep 10 &
pid=$! # Process Id of the previous running command
statu_show