From d4190dfdf751ee609c611922e217f6766b98d1df Mon Sep 17 00:00:00 2001 From: SheetJS Date: Mon, 16 Jun 2014 17:55:48 -0400 Subject: [PATCH] added spin.sh --- misc/spin.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 misc/spin.sh diff --git a/misc/spin.sh b/misc/spin.sh new file mode 100755 index 0000000..9951a57 --- /dev/null +++ b/misc/spin.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# spin.sh -- show a spinner (for coverage test) +# Copyright (C) 2014 SheetJS + +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