2014-04-14 20:45:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# spin.sh -- show a spinner (for coverage test)
|
2016-01-16 03:27:02 +00:00
|
|
|
# Copyright (C) 2014-present SheetJS
|
2014-04-14 20:45:36 +00:00
|
|
|
|
|
|
|
wpid=$1
|
|
|
|
delay=1
|
|
|
|
str="|/-\\"
|
|
|
|
while [ $(ps -a|awk '$1=='$wpid' {print $1}') ]; do
|
|
|
|
t=${str#?}
|
|
|
|
printf " [%c]" "$str"
|
|
|
|
str=$t${str%"$t"}
|
|
|
|
sleep $delay
|
|
|
|
printf "\b\b\b\b"
|
|
|
|
done
|