This is a part of my bash file. The output I need is:
[ - ] Copyright of KatworX? Tech. Developed by Arjun Singh Kathait and Debugged by the ☆Stack Overflow Community☆
I want the spinner animation to continue spinning for 5 seconds while the echo command is being displayed. Can the community help???
spinner()
{
local pid=$!
local delay=0.75
local spinstr='|/-'
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
local temp=${spinstr#?}
printf " [%c] " "$spinstr"
local spinstr=$temp${spinstr%"$temp"}
sleep $delay
printf ""
done
}
sleep 5 & spinner | echo -e "
Copyright of KatworX? Tech. Developed by Arjun Singh Kathait and Debugged by the ☆Stack Overflow Community☆"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…